# Yahoo! UI Library

### datatable 3.3.0

Yahoo! UI Library > datatable > DataTable.Base
Search:
Filters Show Private Show Protected Show Deprecated

## Class DataTable.Base - extends Widget

Base class for the DataTable widget.

### Constructor

DataTable.Base `( )`

### Properties

#### _msgNode - `private Y.Node`

Pointer to message display node.

#### _tbodyNode - `private Y.Node`

Pointer to TBODY node.

#### _theadNode - `private Y.Node`

Pointer to THEAD node.

#### NAME - `static final String`

Class name.

#### tdTemplate - `String`

Tokenized markup template for TD node creation.
Default Value: '
{value}
'

#### thTemplate - `String`

Tokenized markup template for TH node creation.
Default Value: '
{value}
'

#### Properties inherited from Plugin.Host:

`PluginHost`

#### Properties inherited from Attribute:

``

#### Properties inherited from Widget:

`_UI_ATTRS, BOUNDING_TEMPLATE, CONTENT_TEMPLATE, DEF_PARENT_NODE, DEF_UNIT, UI_EVENTS`

#### Properties inherited from Base:

`name`

### Methods

#### _addCaptionNode

`protected void _addCaptionNode ( tableNode )`
Creates and attaches CAPTION element to given container.

Parameters:
  `tableNode <Y.Node>` Parent node.

#### _addColgroupNode

`protected void _addColgroupNode ( tableNode )`
Creates and attaches COLGROUP element to given TABLE.

Parameters:
  `tableNode <Y.Node>` Parent node.

#### _addMessageNode

`protected void _addMessageNode ( tableNode )`
Creates and attaches message display element to given container.

Parameters:
  `tableNode <Y.Node>` Parent node.

#### _addTableNode

`protected void _addTableNode ( containerNode )`
Creates and attaches TABLE element to given container.

Parameters:
  `containerNode <Y.Node>` Parent node.

#### _addTbodyNode

`protected void _addTbodyNode ( tableNode )`
Creates and attaches TBODY element to given container.

Parameters:
  `tableNode <Y.Node>` Parent node.

#### _addTbodyTdNode

`protected void _addTbodyTdNode ( o )`
Creates and attaches data cell element.

Parameters:
  `o <Object} {record, column, tr>` .

#### _addTbodyTrNode

`protected void _addTbodyTrNode ( o )`
Creates and attaches data row element.

Parameters:
  `o <Object} {tbody, record>`

#### _addTheadNode

`protected void _addTheadNode ( tableNode )`
Creates and attaches THEAD element to given container.

Parameters:
  `tableNode <Y.Node>` Parent node.

#### _addTheadThNode

`protected void _addTheadThNode ( o )`
Creates and attaches header cell element.

Parameters:
  `o <Object} {value, column, tr>` .

#### _addTheadTrNode

`protected void _addTheadTrNode ( o , isFirst )`
Creates and attaches header row element.

Parameters:
  `o <Object} {thead, columns>` .
  `isFirst <Boolean>` Is first row.
  `isFirst <Boolean>` Is last row.

#### _afterCaptionChange

`protected void _afterCaptionChange ( e )`
Updates the UI if caption is changed.

Parameters:
  `e <Event>` Custom event for the attribute change.

#### _afterColumnsetChange

`protected void _afterColumnsetChange ( e )`
Updates the UI if Columnset is changed.

Parameters:
  `e <Event>` Custom event for the attribute change.

#### _afterRecordsetChange

`protected void _afterRecordsetChange ( e )`
Updates the UI if Recordset is changed.

Parameters:
  `e <Event>` Custom event for the attribute change.

#### _afterSummaryChange

`protected void _afterSummaryChange ( e )`
Updates the UI if summary is changed.

Parameters:
  `e <Event>` Custom event for the attribute change.

#### _attachTbodyTdNode

`protected void _attachTbodyTdNode ( o )`
Attaches data cell element.

Parameters:
  `o <Object} {record, column, tr, headers, classnames, value>` .

#### _attachTbodyTrNode

`protected void _attachTbodyTrNode ( o )`
Attaches data row element.

Parameters:
  `o <Object} {tbody, record, tr>` .

#### _attachTheadThNode

`protected void _attachTheadThNode ( o )`
Attaches header cell element.

Parameters:
  `o <Object} {value, column, tr>` .

#### _attachTheadTrNode

`protected void _attachTheadTrNode ( o )`
Attaches header row element.

Parameters:
  `o <Object} {thead, columns, tr>` .

#### _createTbodyTdNode

`protected void _createTbodyTdNode ( o )`
Creates data cell element.

Parameters:
  `o <Object} {record, column, tr>` .

#### _createTbodyTrNode

`protected void _createTbodyTrNode ( o )`
Creates data row element.

Parameters:
  `o <Object} {tbody, record>`

#### _createTheadThNode

`protected void _createTheadThNode ( o )`
Creates header cell element.

Parameters:
  `o <Object} {value, column, tr>` .

#### _createTheadTrNode

`protected void _createTheadTrNode ( o , isFirst , isLast )`
Creates header row element.

Parameters:
  `o <Object} {thead, columns>` .
  `isFirst <Boolean>` Is first row.
  `isLast <Boolean>` Is last row.

#### _setColumnset

`private void _setColumnset ( columns )`
Converts Array to Y.Columnset.

Parameters:
  `columns <Array | Y.Columnset>`

#### _setRecordset

`private void _setRecordset ( records )`
Converts Array to Y.Recordset.

Parameters:
  `records <Array | Y.Recordset>`

#### _uiSetCaption

`protected void _uiSetCaption ( val )`
Updates caption.

Parameters:
  `val <String>` New caption.

#### _uiSetColumnset

`protected void _uiSetColumnset ( cs )`
Updates THEAD.

Parameters:
  `cs <Y.Columnset>` New Columnset.

#### _uiSetRecordset

`protected void _uiSetRecordset ( rs )`
Updates TBODY.

Parameters:
  `rs <Y.Recordset>` New Recordset.

#### _uiSetSummary

`protected void _uiSetSummary ( val )`
Updates summary.

Parameters:
  `val <String>` New summary.

#### bindUI

`private void bindUI ( )`
Binds events.

#### destructor

`private void destructor ( )`
Destructor.

#### formatDataCell

`void formatDataCell ( )`
Returns markup to insert into data cell element.

#### initializer

`private void initializer ( config )`
Initializer.

Parameters:
  `config <Object>` Config object.

#### renderUI

`private void renderUI ( )`
Renders UI.

#### syncUI

`private void syncUI ( )`
Syncs UI to intial state.

#### Methods inherited from EventTarget:

`_getType, _monitor, _parseType, addTarget, after, before, bubble, detach, detachAll, fire, getEvent, getTargets, on, once, parseType, publish, removeTarget, subscribe, unsubscribe, unsubscribeAll`

#### Methods inherited from Attribute:

`_addAttrs, _addLazyAttr, _defAttrChangeFn, _fireAttrChange, _getAttr, _getAttrCfg, _getAttrInitVal, _getAttrs, _getStateVal, _isLazyAttr, _normAttrVals, _protectAttrs, _set, _setAttr, _setAttrs, _setAttrVal, _setStateVal, addAttr, addAttrs, attrAdded, get, getAttrs, modifyAttr, removeAttr, reset, set, setAttrs`

#### Methods inherited from Widget:

`_applyParsedConfig, _applyParser, _bindAttrUI, _bindDOM, _bindUI, _createUIEvent, _defaultCB, _defRenderFn, _destroyUIEvents, _getHtmlParser, _getSrcNode, _getStrings, _getUIEventNode, _guid, _initUIEvent, _isUIEvent, _onDocFocus, _onDocMouseDown, _removeLoadingClassNames, _renderBox, _renderBoxClassNames, _renderUI, _setAttrUI, _setBB, _setBox, _setCB, _setStrings, _strSetter, _syncAttrUI, _syncUI, _uiSetDim, _uiSetDisabled, _uiSetFocused, _uiSetHeight, _uiSetTabIndex, _uiSetVisible, _uiSetWidth, _uiSizeCB, _unbindDOM, _unbindUI, _validTabIndex, bindUI, blur, destructor, disable, enable, focus, getClassName, getDefaultLocale, getSkinName, getString, getStrings, hide, initializer, render, renderer, renderUI, show, syncUI, toString`

#### Methods inherited from Base:

`_aggregateAttrs, _defDestroyFn, _defInitFn, _destroyHierarchy, _filterAttrCfs, _getAttrCfgs, _getClasses, _initHierarchy, _initHierarchyData, _preInitEventCfg, destroy, init, toString`

#### Methods inherited from Plugin.Host:

`_destroyPlugins, _initPlugins, hasPlugin, plug, unplug`

### Events

#### captionChange

`captionChange ( event )`
Fires when the value for the configuration attribute 'caption' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### columnsetChange

`columnsetChange ( event )`
Fires when the value for the configuration attribute 'columnset' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### recordsetChange

`recordsetChange ( event )`
Fires when the value for the configuration attribute 'recordset' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### summaryChange

`summaryChange ( event )`
Fires when the value for the configuration attribute 'summary' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### tdValueTemplateChange

`tdValueTemplateChange ( event )`
Fires when the value for the configuration attribute 'tdValueTemplate' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### thValueTemplateChange

`thValueTemplateChange ( event )`
Fires when the value for the configuration attribute 'thValueTemplate' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### trTemplateChange

`trTemplateChange ( event )`
Fires when the value for the configuration attribute 'trTemplate' is changed. You can listen for the event using the on method if you wish to be notified before the attribute's value has changed, or using the after method if you wish to be notified after the attribute's value has changed.

Parameters:
  `event <Event.Facade>` An Event Facade object with the following attribute specific properties added:
  prevVal
    The value of the attribute, prior to it being set
  newVal
    The value the attribute is to be set to
  attrName
    The name of the attribute being set
  subAttrName
    If setting a property within the attribute's value, the name of the sub-attribute property being set

#### Events inherited from Widget:

`boundingBoxChange, contentBoxChange, disabledChange, focusedChange, heightChange, idChange, localeChange, renderChange, renderedChange, srcNodeChange, stringsChange, tabIndexChange, visibleChange, widget:contentUpdate, widget:render, widthChange,`

#### Events inherited from Base:

`destroy, destroyedChange, init, initializedChange,`

### Configuration Attributes

#### caption `- String`

Caption

#### columnset `- Array | Y.Columnset`

Pointer to Columnset instance.

#### recordset `- Array | Y.Recordset`

Pointer to Recordset instance.

#### summary `- String`

Summary.

#### tdValueTemplate `- String`

Tokenized markup template for TD value.
Default Value: '{value}'

#### thValueTemplate `- String`

Tokenized markup template for TH value.
Default Value: '{value}'

#### trTemplate `- String`

Tokenized markup template for TR node creation.
Default Value: '
'

#### Configuration attributes inherited from Widget:

`boundingBox, contentBox, disabled, focused, height, id, locale render rendered srcNode strings tabIndex visible width`

#### Configuration attributes inherited from Base:

`destroyed initialized`

Copyright © 2011 Yahoo! Inc. All rights reserved.