Yahoo! UI Library

DataTable Widget  2.7.0

Yahoo! UI Library > datatable > YAHOO.widget.DataTable
Search:
 
Filters

Class YAHOO.widget.DataTable - extends YAHOO.util.Element

Known Subclasses:
YAHOO.widget.ScrollingDataTable
DataTable class for the YUI DataTable widget.

Constructor

YAHOO.widget.DataTable ( elContainer , aColumnDefs , oDataSource , oConfigs )
Parameters:
elContainer <HTMLElement> Container element for the TABLE.
aColumnDefs <Object[]> Array of object literal Column definitions.
oDataSource <YAHOO.util.DataSource> DataSource instance.
oConfigs <object> (optional) Object literal of configuration values.

Properties

_aDynFunctions - private Array

Sparse array of custom functions to set column widths for browsers that don't support dynamic CSS rules. Functions are added at the index representing the number of rows they update.

_aSelections - private Object[]

Array to track row selections (by sRecordId) and/or cell selections (by {recordId:sRecordId, columnKey:sColumnKey})

_bInit - private Boolean

True if instance is initialized, so as to fire the initEvent after render.
Default Value: true

_elCaption - private HTMLElement

DOM reference to the CAPTION element for the DataTable instance.

_elColgroup - private HTMLElement

DOM reference to the COLGROUP element for the DataTable instance.

_elContainer - private HTMLElement

DOM reference to the container element for the DataTable instance into which all other elements get created.

_elMask - private HTMLElement

DOM reference to the mask element for the DataTable instance which disables it.

_elMsgTbody - private HTMLElement

DOM reference to the secondary TBODY element used to display DataTable messages.

_elMsgTd - private HTMLElement

DOM reference to the secondary TBODY element's single TD element used to display DataTable messages.

_elMsgTr - private HTMLElement

DOM reference to the secondary TBODY element's single TR element used to display DataTable messages.

_elTable - private HTMLElement

DOM reference to the TABLE element for the DataTable instance.

_elTbody - private HTMLElement

DOM reference to the primary TBODY element for the DataTable instance.

_elThead - private HTMLElement

DOM reference to the THEAD element for the DataTable instance.

_elTrTemplate - private {HTMLElement}

Template row to create all new rows from.

_nIndex - private Number

Index assigned to instance.

_nTdCount - private Number

Counter for IDs assigned to TD elements.

_nTrCount - private Number

Counter for IDs assigned to TR elements.

_oAnchorCell - private Object

Object literal representing cell selection anchor: {recordId:sRecordId, columnKey:sColumnKey}.

_oAnchorRecord - private YAHOO.widget.Record

Record instance of the row selection anchor.

_oCellEditor - private YAHOO.widget.CellEditor

The active CellEditor instance for the DataTable instance.

_oChainRender - private YAHOO.util.Chain

Render chain.

_oColumnSet - private YAHOO.widget.ColumnSet

ColumnSet instance for the DataTable instance.

_oDataSource - private YAHOO.util.DataSource

DataSource instance for the DataTable instance.

_oRecordSet - private YAHOO.widget.RecordSet

RecordSet instance for the DataTable instance.

_sFirstTrId - private String

ID string of first TR element of the current DataTable page.

_sId - private String

Unique id assigned to instance "yui-dtN", useful prefix for generating unique DOM ID strings and log messages.

_sLastTrId - private String

ID string of the last TR element of the current DataTable page.

configs - Object

Returns object literal of initial configs.
Default Value: {}

DataTable._bDynStylesFallback - private static boolean

Set to true if _elDynStyleNode cannot be populated due to browser incompatibility.

DataTable._elColumnDragTarget - private static HTMLElement

Element reference to shared Column drag target.

DataTable._elColumnResizerProxy - private static HTMLElement

Element reference to shared Column resizer proxy.

DataTable._elDynStyleNode - private static HTMLElement

Reference to the STYLE node that is dynamically created and updated in order to manage Column widths.

DataTable._nCount - private static Number

Internal class variable for indexing multiple DataTable instances.

DataTable._nCurrentCount - private static Number

Internal class variable tracking current number of DataTable instances, so that certain class values can be reset when all instances are destroyed.

DataTable._oDynStyles - private static Object

Object literal hash of Columns and their dynamically create style rules.

DataTable.CLASS_ASC - static final String

Class name assigned to ascending elements.
Default Value: "yui-dt-asc"

DataTable.CLASS_BUTTON - static final String

Class name assigned to BUTTON elements and/or container elements.
Default Value: "yui-dt-button"

DataTable.CLASS_CHECKBOX - static final String

Class name assigned to INPUT TYPE=CHECKBOX elements and/or container elements.
Default Value: "yui-dt-checkbox"

DataTable.CLASS_COLTARGET - static final String

Class name assigned to Column drag target.
Default Value: "yui-dt-coltarget"

DataTable.CLASS_DATA - static final String

Class name assigned to data elements.
Default Value: "yui-dt-data"

DataTable.CLASS_DATATABLE - static final String

Class name assigned to outer DataTable container.
Default Value: "yui-dt"

DataTable.CLASS_DEFAULT - static final String

Class name assigned to default indicators.
Default Value: "yui-dt-default"

DataTable.CLASS_DESC - static final String

Class name assigned to descending elements.
Default Value: "yui-dt-desc"

DataTable.CLASS_DISABLED - static final String

Class name assigned to disabled elements.
Default Value: "yui-dt-disabled"

DataTable.CLASS_DRAGGABLE - static final String

Class name assigned to draggable elements.
Default Value: "yui-dt-draggable"

DataTable.CLASS_DROPDOWN - static final String

Class name assigned to SELECT elements and/or container elements.
Default Value: "yui-dt-dropdown"

DataTable.CLASS_EDITABLE - static final String

Class name assigned to editable elements.
Default Value: "yui-dt-editable"

DataTable.CLASS_EDITOR - static final String

Class name assigned to CellEditor container elements.
Default Value: "yui-dt-editor"

DataTable.CLASS_EMPTY - static final String

Class name assigned to empty indicators.
Default Value: "yui-dt-empty"

DataTable.CLASS_ERROR - static final String

Class name assigned to error indicators.
Default Value: "yui-dt-error"

DataTable.CLASS_EVEN - static final String

Class name assigned to even elements.
Default Value: "yui-dt-even"

DataTable.CLASS_FIRST - static final String

Class name assigned to first elements.
Default Value: "yui-dt-first"

DataTable.CLASS_HIDDEN - static final String

Class name assigned to hidden elements.
Default Value: "yui-dt-hidden"

DataTable.CLASS_HIGHLIGHTED - static final String

Class name assigned to highlighted elements.
Default Value: "yui-dt-highlighted"

DataTable.CLASS_LABEL - static final String

Class name assigned to display label elements.
Default Value: "yui-dt-label"

DataTable.CLASS_LAST - static final String

Class name assigned to last elements.
Default Value: "yui-dt-last"

DataTable.CLASS_LINER - static final String

Class name assigned to liner DIV elements.
Default Value: "yui-dt-liner"

DataTable.CLASS_LOADING - static final String

Class name assigned to loading indicatorx.
Default Value: "yui-dt-loading"

DataTable.CLASS_MASK - static final String

Class name assigned to mask element when DataTable is disabled.
Default Value: "yui-dt-mask"

DataTable.CLASS_MESSAGE - static final String

Class name assigned to messaging elements.
Default Value: "yui-dt-message"

DataTable.CLASS_NEXT - static final String

Class name assigned next indicators.
Default Value: "yui-dt-next"

DataTable.CLASS_ODD - static final String

Class name assigned to odd elements.
Default Value: "yui-dt-odd"

DataTable.CLASS_PAGE - static final String

Class name assigned to page number indicators.
Default Value: "yui-dt-page"

DataTable.CLASS_PAGINATOR - static final String

Class name assigned to paginator container elements.
Default Value: "yui-dt-paginator"

DataTable.CLASS_PREVIOUS - static final String

Class name assigned to previous indicators.
Default Value: "yui-dt-previous"

DataTable.CLASS_RADIO - static final String

Class name assigned to INPUT TYPE=RADIO elements and/or container elements.
Default Value: "yui-dt-radio"

DataTable.CLASS_RESIZEABLE - static final String

Class name assigned to resizeable elements.
Default Value: "yui-dt-resizeable"

DataTable.CLASS_RESIZER - static final String

Class name assigned to resizer handle elements.
Default Value: "yui-dt-resizer"

DataTable.CLASS_RESIZERLINER - static final String

Class name assigned to resizer liner elements.
Default Value: "yui-dt-resizerliner"

DataTable.CLASS_RESIZERPROXY - static final String

Class name assigned to resizer proxy elements.
Default Value: "yui-dt-resizerproxy"

DataTable.CLASS_SCROLLABLE - static final String

Class name assigned to scrollable elements.
Default Value: "yui-dt-scrollable"

DataTable.CLASS_SELECTED - static final String

Class name assigned to selected elements.
Default Value: "yui-dt-selected"

DataTable.CLASS_SORTABLE - static final String

Class name assigned to sortable elements.
Default Value: "yui-dt-sortable"

DataTable.Formatter - static Object

Cell formatting functions.

Properties inherited from YAHOO.util.Element:

Properties inherited from YAHOO.util.AttributeProvider:

Methods

_clearMinWidth

private void _clearMinWidth ( oColumn )
Clears minWidth.
Parameters:
oColumn <YAHOO.widget.Column> Which Column.
Returns: void

_clearTrTemplateEl

private void _clearTrTemplateEl ( )
Clears TR element template in response to any Column state change.
Returns: void

_createTrEl

private HTMLElement _createTrEl ( oRecord )
Create a new TR element for a given Record and appends it with the correct number of Column-state-classed TD elements. Striping is the responsibility of the calling function, which may decide to stripe the single row, a subset of rows, or all the rows.
Parameters:
oRecord <YAHOO.widget.Record> Record instance
Returns: HTMLElement
The new TR element. This must be added to the DOM.

_defaultPaginatorContainers

private void _defaultPaginatorContainers ( create )
Returns the default containers used for Paginators. If create param is passed, the containers will be created and added to the DataTable container.
Parameters:
create <boolean> Create the default containers if not found
Returns: void

_deleteTrEl

private Boolean _deleteTrEl ( row )
Deletes TR element by DOM reference or by DataTable page row index.
Parameters:
row <HTMLElement | Number> TR element reference or Datatable page row index.
Returns: Boolean
Returns true if successful, else returns false.

_destroyColgroupEl

private void _destroyColgroupEl ( )
Destroy's the DataTable COLGROUP element, if available.
Returns: void

_destroyColumnHelpers

private void _destroyColumnHelpers ( )
Destroys elements associated with Column functionality: ColumnDD and ColumnResizers.
Returns: void

_destroyContainerEl

private void _destroyContainerEl ( elContainer )
Destroy's the DataTable outer container element, if available.
Parameters:
elContainer <HTMLElement> Reference to the container element.
Returns: void

_destroyDraggableColumns

private void _destroyDraggableColumns ( )
Disables DD from top-level Column TH elements.
Returns: void

_destroyMsgTbodyEl

private void _destroyMsgTbodyEl ( )
Destroy's the DataTable message TBODY element, if available.
Returns: void

_destroyResizeableColumns

private void _destroyResizeableColumns ( )
Disables resizeability on key Column TH elements.
Returns: void

_destroyTableEl

private void _destroyTableEl ( )
Destroy's the DataTable TABLE element, if available.
Returns: void

_destroyTbodyEl

private void _destroyTbodyEl ( )
Destroy's the DataTable TBODY element, if available.
Returns: void

_destroyTheadEl

private void _destroyTheadEl ( )
Destroy's the DataTable THEAD element, if available.
Returns: void

_focusEl

private void _focusEl ( el )
Sets focus on the given element.
Parameters:
el <HTMLElement> Element.
Returns: void

_formatTdEl

private HTMLElement _formatTdEl ( oColumn , elTd , index , isLast )
Formats a basic TD element.
Parameters:
oColumn <YAHOO.widget.Column> Associated Column instance.
elTd <HTMLElement> An unformatted TD element.
index <Number> Column key index.
isLast <Boolean> True if Column is last key of the ColumnSet.
Returns: HTMLElement
A formatted TD element.

_getColumnClassnames

private String _getColumnClassnames ( oColumn , aAddClasses )
Retruns classnames to represent current Column states.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
aAddClasses <String[]> An array of additional classnames to add to the return value.
Returns: String
A String of classnames to be assigned to TH or TD elements for given Column.

_getSelectionAnchor

private void _getSelectionAnchor ( oTrigger )
Returns object literal of values that represent the selection anchor. Used to determine selection behavior resulting from a user event.
Parameters:
oTrigger <Object> (Optional) Object literal of selection trigger values (for key events).
Returns: void

_getSelectionTrigger

private void _getSelectionTrigger ( )
Returns object literal of values that represent the selection trigger. Used to determine selection behavior resulting from a key event.
Returns: void

_getTrTemplateEl

private HTMLElement _getTrTemplateEl ( )
Returns a new TR element template with TD elements classed with current Column states.
Returns: HTMLElement
A TR element to be cloned and added to the DOM.

_handleCellBlockSelectionByKey

private void _handleCellBlockSelectionByKey ( e )
Determines selection behavior resulting from a key event when selection mode is set to "cellblock".
Parameters:
e <HTMLEvent> Event object.
Returns: void

_handleCellBlockSelectionByMouse

private void _handleCellBlockSelectionByMouse ( oArgs.event , oArgs.target )
Determines selection behavior resulting from a mouse event when selection mode is set to "cellblock".
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

_handleCellRangeSelectionByKey

private void _handleCellRangeSelectionByKey ( e )
Determines selection behavior resulting from a key event when selection mode is set to "cellrange".
Parameters:
e <HTMLEvent> Event object.
Returns: void

_handleCellRangeSelectionByMouse

private void _handleCellRangeSelectionByMouse ( oArgs.event , oArgs.target )
Determines selection behavior resulting from a mouse event when selection mode is set to "cellrange".
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

_handlePaginatorChange

private void _handlePaginatorChange ( e )
Update the UI infrastructure in response to a "paginator" attribute change.
Parameters:
e <Object> Change event object containing keys 'type','newValue', and 'prevValue'
Returns: void

_handleSingleCellSelectionByKey

private void _handleSingleCellSelectionByKey ( e )
Determines selection behavior resulting from a key event when selection mode is set to "singlecell".
Parameters:
e <HTMLEvent> Event object.
Returns: void

_handleSingleCellSelectionByMouse

private void _handleSingleCellSelectionByMouse ( oArgs.event , oArgs.target )
Determines selection behavior resulting from a mouse event when selection mode is set to "singlecell".
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

_handleSingleSelectionByKey

private void _handleSingleSelectionByKey ( e )
Determines selection behavior resulting from a key event when selection mode is set to "single".
Parameters:
e <HTMLEvent> Event object.
Returns: void

_handleSingleSelectionByMouse

private void _handleSingleSelectionByMouse ( oArgs.event , oArgs.target )
Determines selection behavior resulting from a mouse event when selection mode is set to "single".
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

_handleStandardSelectionByKey

private void _handleStandardSelectionByKey ( e )
Determines selection behavior resulting from a key event when selection mode is set to "standard".
Parameters:
e <HTMLEvent> Event object.
Returns: void

_handleStandardSelectionByMouse

private void _handleStandardSelectionByMouse ( oArgs.event , oArgs.target )
Determines selection behavior resulting from a mouse event when selection mode is set to "standard".
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

_initCaptionEl

private void _initCaptionEl ( sCaption )
Creates HTML markup CAPTION element.
Parameters:
sCaption <String> Text for caption.
Returns: void

_initCellEditing

private void _initCellEditing ( )
Initializes CellEditor integration.
Returns: void

_initCellEditorEl

private void _initCellEditorEl ( )
Backward compatibility.
Returns: void
Deprecated  

_initColgroupEl

private void _initColgroupEl ( elTable )
Initializes COLGROUP and COL elements for managing minWidth.
Parameters:
elTable <HTMLElement> TABLE element into which to create COLGROUP.
Returns: void

_initColumnHelpers

private void _initColumnHelpers ( )
Initializes elements associated with Column functionality: ColumnDD and ColumnResizers.
Returns: void

_initColumnSet

private void _initColumnSet ( aColumnDefs )
Initializes ColumnSet.
Parameters:
aColumnDefs <Object[]> Array of object literal Column definitions.
Returns: void

_initColumnSort

private void _initColumnSort ( )
Initializes Column sorting.
Returns: void

_initConfigs

private void _initConfigs ( oConfig )
Initializes object literal of config values.
Parameters:
oConfig <Object> Object literal of config values.
Returns: void

_initContainerEl

private void _initContainerEl ( elContainer )
Initializes the DataTable outer container element, including a mask.
Parameters:
elContainer <HTMLElement | String> HTML DIV element by reference or ID.
Returns: void

_initDataSource

private void _initDataSource ( oDataSource )
Initializes DataSource.
Parameters:
oDataSource <YAHOO.util.DataSource> DataSource instance.
Returns: void

_initDomElements

private void _initDomElements ( elContainer )
Initializes DOM elements.
Parameters:
elContainer <HTMLElement | String} HTML DIV element by reference or ID. return {Boolean> False in case of error, otherwise true
Returns: void

_initDraggableColumns

private void _initDraggableColumns ( )
Initializes top-level Column TH elements into DD instances.
Returns: void

_initEvents

private void _initEvents ( )
Initialize internal event listeners
Returns: void

_initMsgTbodyEl

private void _initMsgTbodyEl ( elTable )
Initializes TBODY element for messaging.
Parameters:
elTable <HTMLElement> TABLE element into which to create TBODY
Returns: void

_initRecordSet

private void _initRecordSet ( )
Initializes RecordSet.
Returns: void

_initResizeableColumns

private void _initResizeableColumns ( )
Initializes resizeability on key Column TH elements.
Returns: void

_initTableEl

private void _initTableEl ( elContainer )
Creates HTML markup for TABLE, COLGROUP, THEAD and TBODY elements in outer container element.
Parameters:
elContainer <HTMLElement> Container element into which to create TABLE.
Returns: void

_initTbodyEl

private void _initTbodyEl ( elTable )
Initializes TBODY element for data.
Parameters:
elTable <HTMLElement> TABLE element into which to create TBODY .
Returns: void

_initTheadEl

private void _initTheadEl ( elTable , Initialized )
Initializes THEAD element.
Parameters:
elTable <HTMLElement> TABLE element into which to create COLGROUP.
Initialized <HTMLElement> THEAD element.
Returns: void

_initThEl

private void _initThEl ( elTh , oColumn )
Populates TH element as defined by Column.
Parameters:
elTh <HTMLElement> TH element reference.
oColumn <YAHOO.widget.Column> Column object.
Returns: void

_insertColgroupColEl

private void _insertColgroupColEl ( index )
Adds a COL element to COLGROUP at given index.
Parameters:
index <Number> Index of new COL element.
Returns: void

_onDocumentClick

private void _onDocumentClick ( e , oSelf )
Handles click events on the DOCUMENT.
Parameters:
e <HTMLEvent> The click event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onDropdownChange

private void _onDropdownChange ( e , oSelf )
Handles change events on SELECT elements within DataTable.
Parameters:
e <HTMLEvent> The change event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onEditorBlockEvent

private void _onEditorBlockEvent ( oArgs )
Passes through blockEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorBlurEvent

private void _onEditorBlurEvent ( oArgs )
Passes through blurEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorCancelEvent

private void _onEditorCancelEvent ( oArgs )
Passes through cancelEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorKeydownEvent

private void _onEditorKeydownEvent ( oArgs )
Passes through keydownEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorRevertEvent

private void _onEditorRevertEvent ( oArgs )
Passes through revertEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorSaveEvent

private void _onEditorSaveEvent ( oArgs )
Passes through saveEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorShowEvent

private void _onEditorShowEvent ( oArgs )
Passes through showEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onEditorUnblockEvent

private void _onEditorUnblockEvent ( oArgs )
Passes through unblockEvent of the active CellEditor.
Parameters:
oArgs <Object> Custom Event args.
Returns: void

_onRenderChainEnd

private void _onRenderChainEnd ( )
Validates minWidths whenever the render chain ends.
Returns: void

_onTableDblclick

private void _onTableDblclick ( e , oSelf )
Handles dblclick events on the DataTable instance.
Parameters:
e <HTMLEvent> The dblclick event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableFocus

private void _onTableFocus ( e , oSelf )
Handles focus events on the DataTable instance.
Parameters:
e <HTMLEvent> The focus event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableKeypress

private void _onTableKeypress ( e , oSelf )
Handles keypress events on the TABLE. Mainly to support stopEvent on Mac.
Parameters:
e <HTMLEvent> The key event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableMousedown

private void _onTableMousedown ( e , oSelf )
Handles mousedown events on the DataTable instance.
Parameters:
e <HTMLEvent> The mousedown event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableMouseout

private void _onTableMouseout ( e , oSelf )
Handles mouseout events on the DataTable instance.
Parameters:
e <HTMLEvent> The mouseout event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableMouseover

private void _onTableMouseover ( e , oSelf )
Handles mouseover events on the DataTable instance.
Parameters:
e <HTMLEvent> The mouseover event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTableMouseup

private void _onTableMouseup ( e , oSelf )
Handles mouseup events on the DataTable instance.
Parameters:
e <HTMLEvent> The mouseup event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTbodyClick

private void _onTbodyClick ( e , oSelf )
Handles click events on the primary TBODY element.
Parameters:
e <HTMLEvent> The click event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTbodyFocus

private void _onTbodyFocus ( e , oSelf )
Handles focus events on the TBODY element.
Parameters:
e <HTMLEvent> The focus event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTbodyKeydown

private void _onTbodyKeydown ( e , oSelf )
Handles keydown events on the TBODY element. Handles selection behavior, provides hooks for ENTER to edit functionality.
Parameters:
e <HTMLEvent> The key event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTheadClick

private void _onTheadClick ( e , oSelf )
Handles click events on the THEAD element.
Parameters:
e <HTMLEvent> The click event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTheadFocus

private void _onTheadFocus ( e , oSelf )
Handles focus events on the THEAD element.
Parameters:
e <HTMLEvent> The focus event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_onTheadKeydown

private void _onTheadKeydown ( e , oSelf )
Handles keydown events on the THEAD element.
Parameters:
e <HTMLEvent> The key event.
oSelf <YAHOO.wiget.DataTable> DataTable instance.
Returns: void

_removeColgroupColEl

private void _removeColgroupColEl ( index )
Removes a COL element to COLGROUP at given index.
Parameters:
index <Number> Index of removed COL element.
Returns: void

_reorderColgroupColEl

private void _reorderColgroupColEl ( aKeyIndexes , newIndex )
Reorders a COL element from old index(es) to new index.
Parameters:
aKeyIndexes <Number[]> Array of indexes of removed COL element.
newIndex <Number> New index.
Returns: void

_repaintGecko

private void _repaintGecko ( )
Forces Gecko repaint.
Returns: void

_repaintOpera

private void _repaintOpera ( )
Forces Opera repaint.
Returns: void

_repaintWebkit

private void _repaintWebkit ( )
Forces Webkit repaint.
Returns: void

_restoreMinWidth

private void _restoreMinWidth ( oColumn )
Restores minWidth.
Parameters:
oColumn <YAHOO.widget.Column> Which Column.
Returns: void

_runRenderChain

private void _runRenderChain ( )
Internal wrapper calls run() on render Chain instance.
Returns: void

_setColumnWidth

private void _setColumnWidth ( oColumn , sWidth , sOverflow )
Sets liner DIV elements of given Column to given width. When value should be auto-calculated to fit content overflow is set to visible, otherwise overflow is set to hidden. No validations against minimum width and no updating Column.width value.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sWidth <String> New width value.
sOverflow <String> Should be "hidden" when Column width is explicitly being set to a value, but should be "visible" when Column is meant to auto-fit content.
Returns: void

_setColumnWidthDynFunction

private void _setColumnWidthDynFunction ( oColumn , sWidth )
Updates width of a Column's liner DIV elements by dynamically creating a function to update all element style properties in one pass. Note: This technique is not supported in sandboxed environments that prohibit EVALs.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sWidth <String> New width value.
Returns: void

_setColumnWidthDynStyles

private void _setColumnWidthDynStyles ( oColumn , sWidth )
Updates width of a Column's liner DIV elements by dynamically creating a STYLE node and writing and updating CSS style rules to it. If this fails during runtime, the fallback method _setColumnWidthDynFunction() will be called. Notes: This technique is not performant in IE6. IE7 crashes if DataTable is nested within another TABLE element. For these cases, it is recommended to use the method _setColumnWidthDynFunction by setting _bDynStylesFallback to TRUE.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sWidth <String> New width value.
Returns: void

_setFirstRow

private void _setFirstRow ( )
Assigns the class YAHOO.widget.DataTable.CLASS_FIRST to the first TR element of the DataTable page and updates internal tracker.
Returns: void

_setLastRow

private void _setLastRow ( )
Assigns the class YAHOO.widget.DataTable.CLASS_LAST to the last TR element of the DataTable page and updates internal tracker.
Returns: void

_setRowStripes

private void _setRowStripes ( row , range )
Assigns the classes DT.CLASS_EVEN and DT.CLASS_ODD to one, many, or all TR elements.
Parameters:
row <HTMLElement | String | Number> (optional) HTML TR element reference or string ID, or page row index of where to start striping.
range <Number> (optional) If given, how many rows to stripe, otherwise stripe all the rows until the end.
Returns: void

_setSelections

private void _setSelections ( )
Assigns the class DT.CLASS_SELECTED to TR and TD elements.
Returns: void

_syncColWidths

void _syncColWidths ( )
Returns: void
Deprecated Use validateColumnWidths.

_unselectAllTdEls

private void _unselectAllTdEls ( )
Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED from all TD elements in the internal tracker.
Returns: void

_unselectAllTrEls

private void _unselectAllTrEls ( )
Convenience method to remove the class YAHOO.widget.DataTable.CLASS_SELECTED from all TR elements on the page.
Returns: void

_unsetFirstRow

private void _unsetFirstRow ( )
Removes the class YAHOO.widget.DataTable.CLASS_FIRST from the first TR element of the DataTable page and updates internal tracker.
Returns: void

_unsetLastRow

private void _unsetLastRow ( )
Removes the class YAHOO.widget.DataTable.CLASS_LAST from the last TR element of the DataTable page and updates internal tracker.
Returns: void

_updatePaginator

private void _updatePaginator ( newPag )
Method executed during set() operation for the "paginator" attribute. Adds and/or severs event listeners between DataTable and Paginator
Parameters:
newPag <Paginator> Paginator instance (or null) for DataTable to use
Returns: void

_updateTrEl

private HTMLElement _updateTrEl ( elTr , oRecord )
Formats the contents of the given TR's TD elements with data from the given Record. Only innerHTML should change, nothing structural.
Parameters:
elTr <HTMLElement> The TR element to update.
oRecord <YAHOO.widget.Record> The associated Record instance.
Returns: HTMLElement
DOM reference to the new TR element.

addRow

void addRow ( oData , index )
Adds one new Record of data into the RecordSet at the index if given, otherwise at the end. If the new Record is in page view, the corresponding DOM elements are also updated.
Parameters:
oData <Object> Object literal of data for the row.
index <Number> (optional) RecordSet position index at which to add data.
Returns: void

addRows

void addRows ( aData , index )
Convenience method to add multiple rows.
Parameters:
aData <Object[]> Array of object literal data for the rows.
index <Number> (optional) RecordSet position index at which to add data.
Returns: void

cancelCellEditor

void cancelCellEditor ( )
Cancels active CellEditor.
Returns: void

clearTextSelection

void clearTextSelection ( )
Clears browser text selection. Useful to call on rowSelectEvent or cellSelectEvent to prevent clicks or dblclicks from selecting text in the browser.
Returns: void

DataTable._cloneObject

private static void DataTable._cloneObject ( o )
Clones object literal or array of object literals.
Parameters:
o <Object> Object.
Returns: void

DataTable._destroyColumnDragTargetEl

private static void DataTable._destroyColumnDragTargetEl ( )
Destroys shared Column drag target.
Returns: void

DataTable._destroyColumnResizerProxyEl

private static HTMLElement DataTable._destroyColumnResizerProxyEl ( )
Destroys shared Column resizer proxy.
Returns: HTMLElement
Reference to Column resizer proxy.

DataTable._initColumnDragTargetEl

private static HTMLElement DataTable._initColumnDragTargetEl ( )
Creates HTML markup for shared Column drag target.
Returns: HTMLElement
Reference to Column drag target.

DataTable._initColumnResizerProxyEl

private static HTMLElement DataTable._initColumnResizerProxyEl ( )
Creates HTML markup for shared Column resizer proxy.
Returns: HTMLElement
Reference to Column resizer proxy.

DataTable.editCheckbox

void DataTable.editCheckbox ( )
Returns: void
Deprecated Use YAHOO.widget.CheckboxCellEditor.

DataTable.editDate

void DataTable.editDate ( )
Returns: void
Deprecated Use YAHOO.widget.DateCellEditor.

DataTable.editDropdown

void DataTable.editDropdown ( )
Returns: void
Deprecated Use YAHOO.widget.DropdownCellEditor.

DataTable.editRadio

void DataTable.editRadio ( )
Returns: void
Deprecated Use YAHOO.widget.RadioCellEditor.

DataTable.editTextarea

void DataTable.editTextarea ( )
Returns: void
Deprecated Use YAHOO.widget.TextareaCellEditor

DataTable.editTextbox

void DataTable.editTextbox ( )
Returns: void
Deprecated Use YAHOO.widget.TextboxCellEditor

DataTable.formatButton

static void DataTable.formatButton ( el , oRecord , oColumn , oData )
Formats a BUTTON element.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object | Boolean> Data value for the cell. By default, the value is what gets written to the BUTTON.
Returns: void

DataTable.formatCheckbox

static void DataTable.formatCheckbox ( el , oRecord , oColumn , oData )
Formats a CHECKBOX element.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object | Boolean} Data value for the cell. Can be a simple Boolean to indicate whether checkbox is checked or not. Can be object literal {checked:bBoolean, label:sLabel> . Other forms of oData require a custom formatter.
Returns: void

DataTable.formatCurrency

static void DataTable.formatCurrency ( el , oRecord , oColumn , oData )
Formats currency. Default unit is USD.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Number> Data value for the cell.
Returns: void

DataTable.formatDate

static void DataTable.formatDate ( el , oRecord , oColumn , oData )
Formats JavaScript Dates.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> Data value for the cell, or null.
Returns: void

DataTable.formatDefault

static void DataTable.formatDefault ( el , oRecord , oColumn , oData )
Default cell formatter
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> (Optional) Data value for the cell.
Returns: void

DataTable.formatDropdown

static void DataTable.formatDropdown ( el , oRecord , oColumn , oData )
Formats SELECT elements.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> Data value for the cell, or null.
Returns: void

DataTable.formatEmail

static void DataTable.formatEmail ( el , oRecord , oColumn , oData )
Formats emails.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> Data value for the cell, or null.
Returns: void

DataTable.formatLink

static void DataTable.formatLink ( el , oRecord , oColumn , oData )
Formats links.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> Data value for the cell, or null.
Returns: void

DataTable.formatNumber

static void DataTable.formatNumber ( el , oRecord , oColumn , oData )
Formats numbers.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> Data value for the cell, or null.
Returns: void

DataTable.formatRadio

static void DataTable.formatRadio ( el , oRecord , oColumn , oData )
Formats INPUT TYPE=RADIO elements.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> (Optional) Data value for the cell.
Returns: void

DataTable.formatText

static void DataTable.formatText ( el , oRecord , oColumn , oData )
Formats text strings.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> (Optional) Data value for the cell.
Returns: void

DataTable.formatTextarea

static void DataTable.formatTextarea ( el , oRecord , oColumn , oData )
Formats TEXTAREA elements.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> (Optional) Data value for the cell.
Returns: void

DataTable.formatTextbox

static void DataTable.formatTextbox ( el , oRecord , oColumn , oData )
Formats INPUT TYPE=TEXT elements.
Parameters:
el <HTMLElement> The element to format with markup.
oRecord <YAHOO.widget.Record> Record instance.
oColumn <YAHOO.widget.Column> Column instance.
oData <Object> (Optional) Data value for the cell.
Returns: void

DataTable.formatTheadCell

void DataTable.formatTheadCell ( elCellLabel , oColumn , oSortedBy )
Outputs markup into the given TH based on given Column.
Parameters:
elCellLabel <HTMLElement> The label SPAN element within the TH liner, not the liner DIV element.
oColumn <YAHOO.widget.Column> Column instance.
oSortedBy <Object> Sort state object literal.
Returns: void
Deprecated Use formatTheadCell.

DataTable.validateNumber

static void DataTable.validateNumber ( oData )
Validates data value to type Number, doing type conversion as necessary. A valid Number value is return, else null is returned if input value does not validate.
Parameters:
oData <Object> Data to validate.
Returns: void

deleteRow

void deleteRow ( row )
Deletes the given row's Record from the RecordSet. If the row is on current page, the corresponding DOM elements are also deleted.
Parameters:
row <HTMLElement | String | Number> DOM element reference or ID string to DataTable page element or RecordSet index.
Returns: void

deleteRows

void deleteRows ( row , count )
Convenience method to delete multiple rows.
Parameters:
row <HTMLElement | String | Number> DOM element reference or ID string to DataTable page element or RecordSet index.
count <Number> (optional) How many rows to delete. A negative value will delete towards the beginning.
Returns: void

destroy

void destroy ( )
Nulls out the entire DataTable instance and related objects, removes attached event listeners, and clears out DOM elements inside the container. After calling this method, the instance reference should be expliclitly nulled by implementer, as in myDataTable = null. Use with caution!
Returns: void

destroyCellEditor

void destroyCellEditor ( )
Destroys active CellEditor instance and UI.
Returns: void

disable

void disable ( )
Disables DataTable UI.
Returns: void

doBeforeLoadData

Boolean doBeforeLoadData ( sRequest , oResponse , oPayload )
Overridable method gives implementers a hook to access data before it gets added to RecordSet and rendered to the TBODY.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
oPayload <MIXED> additional arguments
Returns: Boolean
Return true to continue loading data into RecordSet and updating DataTable with new Records, false to cancel.

doBeforePaginatorChange

Boolean doBeforePaginatorChange ( oPaginatorState )
Overridable method gives implementers a hook to show loading message before changing Paginator value.
Parameters:
oPaginatorState <Object> An object literal describing the proposed pagination state.
Returns: Boolean
Return true to continue changing Paginator value.

doBeforeShowCellEditor

Boolean doBeforeShowCellEditor ( oCellEditor )
Overridable abstract method to customize CellEditor before showing.
Parameters:
oCellEditor <YAHOO.widget.CellEditor> The CellEditor instance.
Returns: Boolean
Return true to continue showing CellEditor.

doBeforeSortColumn

Boolean doBeforeSortColumn ( oColumn , sSortDir )
Overridable method gives implementers a hook to show loading message before sorting Column.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sSortDir <String> YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.
Returns: Boolean
Return true to continue sorting Column.

focus

void focus ( )
Brings focus to the TBODY element. Alias to focusTbodyEl.
Returns: void

focusTbodyEl

void focusTbodyEl ( )
Brings focus to the TBODY element.
Returns: void

focusTheadEl

void focusTheadEl ( )
Brings focus to the THEAD element.
Returns: void

formatCell

void formatCell ( elCell , oRecord , oColumn )
Outputs markup into the given TD based on given Record.
Parameters:
elCell <HTMLElement> The liner DIV element within the TD.
oRecord <YAHOO.widget.Record> (Optional) Record instance.
oColumn <YAHOO.widget.Column> (Optional) Column instance.
Returns: void

getAboveTdEl

HTMLElement getAboveTdEl ( cell )
Returns DOM reference to the above TD element from the given cell, or null.
Parameters:
cell <HTMLElement | String | Object} DOM element reference or string ID, or object literal of syntax {record:oRecord, column:oColumn> from which to get next TD element.
Returns: HTMLElement
Reference to next TD element, or null.

getBelowTdEl

HTMLElement getBelowTdEl ( cell )
Returns DOM reference to the below TD element from the given cell, or null.
Parameters:
cell <HTMLElement | String | Object} DOM element reference or string ID, or object literal of syntax {record:oRecord, column:oColumn> from which to get previous TD element.
Returns: HTMLElement
Reference to previous TD element, or null.

getBody

void getBody ( )
Returns: void
Deprecated Use getTbodyEl().

getCell

void getCell ( )
Returns: void
Deprecated Use getTdEl().

getCellEditor

YAHOO.widget.CellEditor getCellEditor ( )
Returns current CellEditor instance, or null.
Returns: YAHOO.widget.CellEditor
CellEditor instance.

getColumn

YAHOO.widget.Column getColumn ( column )
For the given identifier, returns the associated Column instance. Note: For getting Columns by Column ID string, please use the method getColumnById().
Parameters:
column <HTMLElement | String | Number> TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: YAHOO.widget.Column
Column instance.

getColumnById

YAHOO.widget.Column getColumnById ( column )
For the given Column ID, returns the associated Column instance. Note: For getting Columns by key, please use the method getColumn().
Parameters:
column <String> Column ID string.
Returns: YAHOO.widget.Column
Column instance.

getColumnSet

YAHOO.widget.ColumnSet getColumnSet ( )
Returns the DataTable instance's ColumnSet instance.
Returns: YAHOO.widget.ColumnSet
ColumnSet instance.

getColumnSortDir

String getColumnSortDir ( oColumn , oSortedBy )
For the given Column instance, returns next direction to sort.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
oSortedBy <Object> (optional) Specify the state, or use current state.
Returns: String
YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTableCLASS_DESC.

getContainerEl

HTMLElement getContainerEl ( )
Returns DOM reference to the DataTable's container element.
Returns: HTMLElement
Reference to DIV element.

getDataSource

YAHOO.util.DataSource getDataSource ( )
Returns the DataTable instance's DataSource instance.
Returns: YAHOO.util.DataSource
DataSource instance.

getFirstTdEl

HTMLElement getFirstTdEl ( row )
Returns DOM reference to the first TD element in the DataTable page (by default), the first TD element of the optionally given row, or null.
Parameters:
row <HTMLElement> (optional) row from which to get first TD
Returns: HTMLElement
Reference to TD element.

getFirstTrEl

HTMLElement getFirstTrEl ( )
Returns DOM reference to the first TR element in the DataTable page, or null.
Returns: HTMLElement
Reference to TR element.

getId

String getId ( )
Returns unique id assigned to instance, which is a useful prefix for generating unique DOM ID strings.
Returns: String
Unique ID of the DataSource instance.