# Yahoo! UI Library

### DataTable Widget 2.5.0

Yahoo! UI Library > datatable > YAHOO.widget.Column

Show Private Show Protected

## Class YAHOO.widget.Column

The Column class defines and manages attributes of DataTable Columns

### Constructor

YAHOO.widget.Column `( oConfigs )`

Parameters:
  `oConfigs <Object>` Object literal of definitions.

### Properties

#### _dd `- private YAHOO.util.DragDrop`

For unreg() purposes, a reference to the Column's DragDrop instance.

#### _ddResizer `- private YAHOO.util.DragDrop`

For unreg() purposes, a reference to the Column resizer's DragDrop instance.

#### _elResizer `- private HTMLElement`

The DOM reference to the associated resizerelement (if any).

#### _elTh `- private HTMLElement`

The DOM reference to the associated TH element.

#### _nColspan `- private Number`

Number of table cells the Column spans.

#### _nKeyIndex `- private 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.

#### _nRowspan `- private Number`

Number of table rows the Column spans.

#### _nTreeIndex `- private Number`

Reference to Column's current position index within its ColumnSet's tree array, if applicable. This property only applies to non-nested and top- level parent Columns.

#### _oDefinition `- private Object`

Object literal definition

#### _oParent `- private YAHOO.widget.Column`

Column's parent Column instance, or null.

#### _sId `- private String`

Unique String identifier assigned at instantiation.

#### abbr `- String`

Column head cell ABBR for accessibility.

#### children `- Object[]`

Array of object literals that define children (nested headers) of a Column.

#### className `- String || String[]`

Custom CSS class or array of classes to be applied to every cell in the Column.

#### Column._nCount `- private static Number`

Internal class variable to index multiple Column instances.

#### editor `- String || HTMLFunction`

Defines an editor function, otherwise Column is not editable.

#### editorOptions `- Object`

Defines editor options for Column in an object literal of param:value pairs.

#### formatter `- String || HTMLFunction`

Defines a format function.

#### hidden `- Boolean`

True if Column is in hidden state.
Default Value: false

#### key `- String`

Associated database field, or null.

#### label `- String`

Text or HTML for display as Column's label in the TH element.

#### minWidth `- Number`

Minimum Column width (in pixels).
Default Value: 10

#### resizeable `- Boolean`

True if Column is resizeable, false otherwise. The Drag & Drop Utility is required to enable this feature. Only bottom-level and non-nested Columns are resizeble.
Default Value: false

#### selected `- Boolean`

True if Column is in selected state.
Default Value: false

#### sortable `- Boolean`

True if Column is sortable, false otherwise.
Default Value: false

#### sortOptions.defaultDir `- String`

Default sort direction for Column: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.
Default Value: null

#### sortOptions.defaultOrder `- object`

Deprecated: Use sortOptions.defaultDir.

#### sortOptions.sortFunction `- Function`

Custom sort handler.
Default Value: null

#### width `- Number`

Column width (in pixels).

### Methods

#### getColEl

`void getColEl ( )`

Returns: `void`

Deprecated Use getThEl

#### getColspan

`Number getColspan ( )`
Public accessor returns Column's calculated COLSPAN value.

Returns: `Number`
  Column's COLSPAN value.

#### getDefinition

`Object getDefinition ( )`
Returns object literal definition.

Returns: `Object`
  Object literal definition.

#### getId

`String getId ( )`
Returns unique ID string.

Returns: `String`
  Unique ID string.

#### getKey

`String getKey ( )`
Returns unique Column key.

Returns: `String`
  Column key.

#### getKeyIndex

`Number getKeyIndex ( )`
Public accessor returns Column's current position index within its ColumnSet's keys array, if applicable. Only non-nested and bottom-level child Columns will return a value.

Returns: `Number`
  Position index, or null.

#### getParent

`YAHOO.widget.Column getParent ( )`
Public accessor returns Column's parent instance if any, or null otherwise.

Returns: `YAHOO.widget.Column`
  Column's parent instance.

#### getResizerEl

`HTMLElement getResizerEl ( )`
Returns DOM reference to the resizer element, or null.

Returns: `HTMLElement`
  DIV element.

#### getRowspan

`Number getRowspan ( )`
Public accessor returns Column's calculated ROWSPAN value.

Returns: `Number`
  Column's ROWSPAN value.

#### getThEl

`HTMLElement getThEl ( )`
Returns DOM reference to the key TH element.

Returns: `HTMLElement`
  TH element.

#### getTreeIndex

`Number getTreeIndex ( )`
Public accessor returns Column's current position index within its ColumnSet's tree array, if applicable. Only non-nested and top-level parent Columns will return a value;

Returns: `Number`
  Position index, or null.

#### toString

`String toString ( )`
Column instance name, for logging.

Returns: `String`
  Column's unique name.

Copyright © 2007 Yahoo! Inc. All rights reserved.