# Yahoo! UI Library

### datatable 3.3.0

Yahoo! UI Library > datatable > Column
Search:
Filters Show Private Show Protected Show Deprecated

## Class Column - extends Widget

The Column class defines and manages attributes of Columns for DataTable.

### Constructor

Column `( )`

### Properties

#### colSpan - `Number`

Number of cells the header spans. Value is set by Columnset code.
Default Value: 1

#### headers - `String[]`

Array of TH IDs associated with this column, for TD "headers" attribute. Value is set by Columnset code

#### keyIndex - `Number`

Reference to Column's current position index within its Columnset's keys array, if applicable. This property only applies to non-nested and bottom- level child Columns. Value is set by Columnset code.

#### NAME - `static final String`

Class name.

#### parent - `Y.Column`

Column's parent Column instance, if applicable. Value is set by Columnset code.

#### rowSpan - `Number`

Number of rows the header spans. Value is set by Columnset code.
Default Value: 1

#### thNode - `Y.Node`

The Node reference to the associated TH element.

#### 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

#### _afterAbbrChange

`private void _afterAbbrChange ( e )`
Updates the UI if changes are made to abbr.

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

#### _defaultField

`private void _defaultField ( )`
Return field for instance. Defaults to key if one was not provided.

#### _defaultId

`private void _defaultId ( )`
Return ID for instance.

#### _defaultKey

`private void _defaultKey ( )`
Return key for instance. Defaults to ID if one was not provided.

#### _defaultLabel

`private void _defaultLabel ( )`
Return label for instance. Defaults to key if one was not provided.

#### _getClassnames

`private void _getClassnames ( )`
Returns classnames for Column.

#### _uiSetAbbr

`protected void _uiSetAbbr ( val )`
Updates abbr.

Parameters:
  `val <String>` New abbr.

#### destructor

`private void destructor ( )`
Destructor.

#### initializer

`private void initializer ( config )`
Initializer.

Parameters:
  `config <Object>` Config object.

#### 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

#### abbrChange

`abbrChange ( event )`
Fires when the value for the configuration attribute 'abbr' 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

#### childrenChange

`childrenChange ( event )`
Fires when the value for the configuration attribute 'children' 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

#### fieldChange

`fieldChange ( event )`
Fires when the value for the configuration attribute 'field' 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

#### idChange

`idChange ( event )`
Fires when the value for the configuration attribute 'id' 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

#### keyChange

`keyChange ( event )`
Fires when the value for the configuration attribute 'key' 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

#### labelChange

`labelChange ( event )`
Fires when the value for the configuration attribute 'label' 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

#### abbr `- String`

TH abbr attribute.

#### children `- String`

Array of child column definitions (for nested headers).

#### field `- String`

Points to underlying data field (for sorting or formatting, for example). Useful when column doesn't hold any data itself, but is just a visual representation of data from another column or record field. Defaults to key.

#### id `- String`

Unique internal identifier, used to stamp ID on TH element.

#### key `- String`

User-supplied identifier. Defaults to id.

#### label `- String`

Display label for column header. Defaults to key.

#### 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.