YUI recommends YUI 3.

YUI 2 has been deprecated since 2011. This site acts as an archive for files and documentation.

Yahoo! UI Library

DataTable Widget  2.5.0

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

Show Private Show Protected

Class YAHOO.widget.DataTable - uses YAHOO.util.EventProvider

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

_aFallbackColResizer - 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, columnId:sColumnId})

_bInit - private Boolean

True if instance is initialized, so as to fire the initEvent rather than renderEvent.
Default Value: true

_bScrollbarX - private {Boolean}

True if x-scrollbar is currently visible.

_elCaption - private HTMLElement

DOM reference to the CAPTION 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.

_elMsgTbody - private HTMLElement

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

_elMsgTbodyCell - private HTMLElement

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

_elMsgTbodyRow - private HTMLElement

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

_elTbody - private HTMLElement

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

_elTbodyContainer - private HTMLElement

DOM reference to the container element for the DataTable's primary TBODY.

_elThead - private HTMLElement

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

_elTheadContainer - private HTMLElement

DOM reference to the container element for the DataTable's primary THEAD.

_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, columnId:sColumnId}.

_oAnchorRecord - private YAHOO.widget.Record

Record instance of the row selection anchor.

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

_sLastHighlightedTdElId - private String

ID string of last highlighted cell element

_sLastHighlightedTrElId - private String

ID string of last highlighted row element

_sLastTrId - private String

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

_tdElTemplate - private {HTMLElement}

Template cell to create all new cells from.

_trElTemplate - private {HTMLElement}

Template row to create all new rows from.

DataTable._bStylesheetFallback - private static boolean

Set to true if _elStylesheet 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._elStylesheet - private static HTMLElement

Reference to STYLE node that is dynamically created and written to 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._oStylesheetRules - 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_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 Editor 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_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_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.

DataTable.MSG_EMPTY - static final String

Message to display if DataTable has no data.
Default Value: "No records found."

DataTable.MSG_ERROR - static final String

Message to display while DataTable has data error.
Default Value: "Data error."

DataTable.MSG_LOADING - static final String

Message to display while DataTable is loading data.
Default Value: "Loading data..."

Methods

_addTdEl

private HTMLElement _addTdEl ( elRow , oColumn , index )
Creates a cell within the specified row and column.
Parameters:
elRow <HTMLElement> The row to add the cell to
oColumn <Column> The column definition to use for the cell
index <number> (optional) the index to add the cell at (default null)
Returns: HTMLElement
the new cell

_createTrEl

private HTMLElement _createTrEl ( oRecord )
Create a TR element for a given Record.
Parameters:
oRecord <YAHOO.widget.Record> Record instance
Returns: HTMLElement
The new TR element. This must be added to the DOM.

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

_focusEl

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

_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

_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

_handleDataReturnPayload

private void _handleDataReturnPayload ( oRequest , oResponse , oPayload )
Updates the DataTable with data sent in an onDataReturn* payload
Parameters:
oRequest <MIXED> Original generated request.
oResponse <Object> Response object.
oPayload <MIXED> Additional argument(s)
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

_initCellEditorEl

private void _initCellEditorEl ( )
Creates HTML markup for Cell Editor.
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 container element.
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

_initNodeTemplates

private void _initNodeTemplates ( )
Initializes the HTMLElement templates used to create various table child nodes.
Returns: void

_initRecordSet

private void _initRecordSet ( )
Initializes RecordSet.
Returns: void

_initTableEl

private void _initTableEl ( )
Creates HTML markup for TABLE, THEAD and TBODY elements.
Returns: void

_initTheadEls

private void _initTheadEls ( )
Initializes THEAD elements for display and for screen readers.
Returns: void

_initThEl

private void _initThEl ( elTheadCell , oColumn , row , col , bA11y )
Populates TH cell as defined by Column.
Parameters:
elTheadCell <HTMLElement> TH cell element reference.
oColumn <YAHOO.widget.Column> Column object.
row <Number> Row index.
col <Number> Column index.
bA11y <Boolean> True if TH is for accessibility, so as not to initialize presentation elements.
Returns: void

_onDocumentClick

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

_onPaginatorDropdownChange

private void _onPaginatorDropdownChange ( )
Returns: void
Deprecated Use Paginator class APIs.

_onPaginatorLinkClick

private void _onPaginatorLinkClick ( )
Returns: void
Deprecated Use Paginator class APIs.

_onScroll

private void _onScroll ( e , oSelf )
Syncs scrolltop and scrollleft of all TABLEs.
Parameters:
e <HTMLEvent> The scroll event.
oSelf <DT> DataTable instance
Returns: void

_onTableDblclick

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

_onTableFocus

private void _onTableFocus ( e , oSelf )
Handles focus events on the DataTable instance.
Parameters:
e <HTMLEvent> The focus event.
oSelf <DT> 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 <DT> DataTable instance.
Returns: void

_onTableMousedown

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

_onTableMouseout

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

_onTableMouseover

private void _onTableMouseover ( e , oSelf )
Handles mouseover events on the DataTable instance.
Parameters:
e <HTMLEvent> The mouseover event.
oSelf <DT> 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 <DT> DataTable instance.
Returns: void

_onTbodyFocus

private void _onTbodyFocus ( e , oSelf )
Handles focus events on the TBODY element.
Parameters:
e <HTMLEvent> The focus event.
oSelf <DT> 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 <DT> DataTable instance.
Returns: void

_onTheadClick

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

_onTheadFocus

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

_onTheadKeydown

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

_setColumnWidth

private void _setColumnWidth ( oColumn , sWidth )
Sets DOM elements of given Column to given pixel width. No validations against minimum width and no updating Column.width value.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sWidth <String> New width value.
Returns: void

_setFirstRow

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

_setLastRow

private void _setLastRow ( )
Assigns the class DT.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 alternating TR elements of the DataTable page. For performance, a subset of rows may be specified.
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

_syncColWidths

private void _syncColWidths ( )
Syncs up widths of THs and TDs across all those Columns without width values. Actual adjustment is to the liner DIVs so window resizing will not affect cells.
Returns: void

_syncScrollPadding

private void _syncScrollPadding ( )
Syncs padding around scrollable tables, including Column header right-padding and container width and height.
Returns: void

_unselectAllTdEls

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

_unselectAllTrEls

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

_updateTrEl

private HTMLElement _updateTrEl ( elRow , oRecord )
Formats all TD elements of given TR element with data from the given Record.
Parameters:
elRow <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 Cell Editor.
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._generateRequest

private static void DataTable._generateRequest ( oData , oDataTable )
Translates (proposed) DataTable state data into a form consumable by DataSource sendRequest as the request parameter. Use set('generateParameter', yourFunc) to use a custom function rather than this one.
Parameters:
oData <Object> Object literal defining the current or proposed state
oDataTable <DataTable> Reference to the DataTable instance
Returns: void

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

static void DataTable.editCheckbox ( oEditor , oSelf )
Enables CHECKBOX Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

DataTable.editDate

static void DataTable.editDate ( oEditor , oSelf )
Enables Date Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

DataTable.editDropdown

static void DataTable.editDropdown ( oEditor , oSelf )
Enables SELECT Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

DataTable.editRadio

static void DataTable.editRadio ( oEditor , oSelf )
Enables INPUT TYPE=RADIO Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

DataTable.editTextarea

static void DataTable.editTextarea ( oEditor , oSelf )
Enables TEXTAREA Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

DataTable.editTextbox

static void DataTable.editTextbox ( oEditor , oSelf )
Enables INPUT TYPE=TEXT Editor.
Parameters:
oEditor <Object> Object literal representation of Editor values.
oSelf <DT> Reference back to DataTable instance.
Returns: void

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

static void DataTable.formatTheadCell ( elCellLabel , oColumn , oSelf )
Outputs markup into the given TH based on given Column.
Parameters:
elCellLabel <HTMLElement> The label DIV element within the TH liner.
oColumn <YAHOO.widget.Column> Column instance.
oSelf <DT> DataTable instance.
Returns: void

DataTable.handleDataSourcePagination

static void DataTable.handleDataSourcePagination ( the )
Handles Pag changeRequest events for dynamic DataSources such as DataSource.TYPE_XHR or DataSource.TYPE_JSFUNCTION.
Parameters:
the <object> requested state of the pagination
the <DataTable> DataTable instance
Returns: void

DataTable.handleSimplePagination

static void DataTable.handleSimplePagination ( the )
Handles Pag changeRequest events for static DataSources (i.e. DataSources that return all data immediately)
Parameters:
the <object> requested state of the pagination
the <DataTable> DataTable instance
Returns: void

DataTable.validateNumber

static void DataTable.validateNumber ( oData )
Validates Editor input value to type Number, doing type conversion as necessary. A valid Number value is return, else the previous value 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

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.

doBeforeShowCellEditor

void doBeforeShowCellEditor ( oCellEditor )
Overridable abstract method to customize Cell Editor UI.
Parameters:
oCellEditor <Object> Cell Editor object literal.
Returns: void

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

formatPaginatorDropdown

void formatPaginatorDropdown ( )
Returns: void
Deprecated Use Paginator class APIs.

formatPaginatorLinks

void formatPaginatorLinks ( )
Returns: void
Deprecated Use Paginator class APIs.

formatPaginators

void formatPaginators ( )
Returns: void
Deprecated Use Paginator class APIs.

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

Object getCellEditor ( )
Returns the DataTable instance's Cell Editor as an object literal with the following properties:
cell
{HTMLElement} Cell element being edited.
column
{YAHOO.widget.Column} Associated Column instance.
container
{HTMLElement} Reference to editor's container DIV element.
isActive
{Boolean} True if cell is currently being edited.
record
{YAHOO.widget.Record} Associated Record instance.
validator
{HTMLFunction} Associated validator function called before new data is stored. Called within the scope of the DataTable instance, the function receieves the following arguments:
oNewData
{Object} New data to validate.
oOldData
{Object} Original data in case of reversion.
oCellEditor
{Object} Object literal representation of Editor values.
defaultValue
Dynamically settable default value
value
Current input value
Returns: Object
Cell Editor object literal values.

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> DOM reference or ID string to a 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 )
For the given Column instance, returns next direction to sort.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
Returns: String
DataTable.widget.CLASS_ASC or DataTable.widget.CLASS_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.

getLastSelectedCell

Object getLastSelectedCell ( )
Returns last selected cell as an object literal: {recordId:sRecordId, columnId:sColumnId}.
Returns: Object
Object literal representation of a cell.

getLastSelectedRecord

String getLastSelectedRecord ( )
Returns last selected Record ID.
Returns: String
Record ID of last selected row.

getLastTdEl

HTMLElement getLastTdEl ( )
Returns DOM reference to the last TD element in the DataTable page (by default), the first TD element of the optionally given row, or null.
Returns: HTMLElement
Reference to last TD element.

getLastTrEl

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

getMsgTbodyEl

HTMLElement getMsgTbodyEl ( )
Returns DOM reference to the DataTable's secondary TBODY element that is used to display messages.
Returns: HTMLElement
Reference to TBODY element.

getMsgTdEl

HTMLElement getMsgTdEl ( )
Returns DOM reference to the TD element within the secondary TBODY that is used to display messages.
Returns: HTMLElement
Reference to TD element.

getNextTdEl

HTMLElement getNextTdEl ( cell )
Returns DOM reference to the next 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.

getNextTrEl

HTMLElement getNextTrEl ( row )
Returns DOM reference to the next TR element from the given TR element, or null.
Parameters:
row <HTMLElement | String | Number | YAHOO.widget.Record> Element reference, ID string, page row index, or Record from which to get next TR element.
Returns: HTMLElement
Reference to next TR element.

getPreviousTdEl

HTMLElement getPreviousTdEl ( cell )
Returns DOM reference to the previous 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.

getPreviousTrEl

HTMLElement getPreviousTrEl ( row )
Returns DOM reference to the previous TR element from the given TR element, or null.
Parameters:
row <HTMLElement | String | Number | YAHOO.widget.Record> Element reference, ID string, page row index, or Record from which to get previous TR element.
Returns: HTMLElement
Reference to previous TR element.

getRecord

YAHOO.widget.Record getRecord ( row )
For the given identifier, returns the associated Record instance.
Parameters:
row <HTMLElement | Number | String> DOM reference to a TR element (or child of a TR element), RecordSet position index, or Record ID.
Returns: YAHOO.widget.Record
Record instance.

getRecordIndex

Number getRecordIndex ( row )
Returns Record index for given TR element or page row index.
Parameters:
row <YAHOO.widget.Record | HTMLElement | Number> Record instance, TR element reference or page row index.
Returns: Number
Record's RecordSet index, or null.

getRecordSet

YAHOO.widget.RecordSet getRecordSet ( )
Returns the DataTable instance's RecordSet instance.
Returns: YAHOO.widget.RecordSet
RecordSet instance.

getRow

void getRow ( )
Returns: void
Deprecated Use getTrEl().

getSelectedCells

Object[] getSelectedCells ( )
Returns selected cells as an array of object literals: {recordId:sRecordId, columnId:sColumnId}.
Returns: Object[]
Array of selected cells by Record ID and Column ID.

getSelectedColumns

YAHOO.widget.Column[] getSelectedColumns ( )
Returns an array selected Column instances.
Returns: YAHOO.widget.Column[]
Array of Column instances.

getSelectedRows

String[] getSelectedRows ( )
Returns selected rows as an array of Record IDs.
Returns: String[]
Array of selected rows by Record ID.

getSelectedTdEls

HTMLElement[] getSelectedTdEls ( )
Returns array of selected TD elements on the page.
Returns: HTMLElement[]
Array of selected TD elements.

getSelectedTrEls

HTMLElement[] getSelectedTrEls ( )
Returns array of selected TR elements on the page.
Returns: HTMLElement[]
Array of selected TR elements.

getTbodyEl

HTMLElement getTbodyEl ( )
Returns DOM reference to the DataTable's primary TBODY element.
Returns: HTMLElement
Reference to TBODY element.

getTdEl

HTMLElement getTdEl ( cell )
Returns DOM reference to a TD element.
Parameters:
cell <HTMLElement | String | Object} DOM element reference or string ID, or object literal of syntax {record:oRecord, column:oColumn> .
Returns: HTMLElement
Reference to TD element.

getTdLinerEl

HTMLElement getTdLinerEl ( cell )
Returns DOM reference to a TD liner element.
Parameters:
cell <HTMLElement | String | Object} DOM element reference or string ID, or object literal of syntax {record:oRecord, column:oColumn> .
Returns: HTMLElement
Reference to TD liner element.

getTheadEl

HTMLElement getTheadEl ( )
Returns DOM reference to the DataTable's THEAD element.
Returns: HTMLElement
Reference to THEAD element.

getThEl

HTMLElement getThEl ( theadCell )
Returns DOM reference to a TH element.
Parameters:
theadCell <YAHOO.widget.Column | HTMLElement | String> Column instance, DOM element reference, or string ID.
Returns: HTMLElement
Reference to TH element.

getThLinerEl

HTMLElement getThLinerEl ( theadCell )
Returns DOM reference to a TH liner element.
Parameters:
theadCell <YAHOO.widget.Column | HTMLElement | String> Column instance, DOM element reference, or string ID.
Returns: HTMLElement
Reference to TH liner element.

getTrEl

HTMLElement getTrEl ( row )
Returns the corresponding TR reference for a given DOM element, ID string or directly page row index. If the given identifier is a child of a TR element, then DOM tree is traversed until a parent TR element is returned, otherwise null.
Parameters:
row <HTMLElement | String | Number | YAHOO.widget.Record> Which row to get: by element reference, ID string, page row index, or Record.
Returns: HTMLElement
Reference to TR element, or null.

getTrIndex

Number getTrIndex ( row )
Returns the page row index of given row. Returns null if the row is not on the current DataTable page.
Parameters:
row <HTMLElement | String | YAHOO.widget.Record | Number> DOM or ID string reference to an element within the DataTable page, a Record instance, or a Record's RecordSet index.
Returns: Number
Page row index, or null if row does not exist or is not on current page.

hideColumn

void hideColumn ( oColumn )
Hides given Column. NOTE: You cannot hide/show nested Columns. You can only hide/show non-nested Columns, and top-level parent Columns (which will hide/show all children Columns).
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
Returns: void

hideTableMessage

void hideTableMessage ( )
Hides secondary TBODY.
Returns: void

highlightCell

void highlightCell ( cell )
Assigns the class DT.CLASS_HIGHLIGHTED to the given cell.
Parameters:
cell <HTMLElement | String> DOM element reference or ID string.
Returns: void

highlightColumn

void highlightColumn ( column )
Assigns the class DT.CLASS_HIGHLIGHTED to cells of the given Column. NOTE: You cannot highlight/unhighlight nested Columns. You can only highlight/unhighlight non-nested Columns, and bottom-level key Columns.
Parameters:
column <HTMLElement | String | Number> DOM reference or ID string to a TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: void

highlightRow

void highlightRow ( row )
Assigns the class DT.CLASS_HIGHLIGHTED to the given row.
Parameters:
row <HTMLElement | String> DOM element reference or ID string.
Returns: void

initAttributes

private void initAttributes ( oConfigs )
Implementation of Element's abstract method. Sets up config values.
Parameters:
oConfigs <Object> (Optional) Object literal definition of configuration values.
Returns: void

initializeTable

void initializeTable ( )
Resets a RecordSet with the given data and populates the page view with the new data. Any previous data and selection states are cleared. However, sort states are not cleared, so if the given data is in a particular sort order, implementers should take care to reset the sortedBy property. If pagination is enabled, the currentPage is shown and Paginator UI updated, otherwise all rows are displayed as a single page. For performance, existing DOM elements are reused when possible.
Returns: void

insertColumn

void insertColumn ( oColumn , index )
Inserts given Column at the index if given, otherwise at the end. NOTE: You can only add non-nested Columns and top-level parent Columns. You cannot add a nested Column to an existing parent.
Parameters:
oColumn <Object | YAHOO.widget.Column> Object literal Column definition or a Column instance.
index <Number> (optional) Column key index.
Returns: void

isSelected

Boolean isSelected ( o )
Returns true if given item is selected, false otherwise.
Parameters:
o <String | HTMLElement | YAHOO.widget.Record | Number {record:YAHOO.widget.Record, column:YAHOO.widget.Column} > TR or TD element by reference or ID string, a Record instance, a RecordSet position index, or an object literal representation of a cell.
Returns: Boolean
True if item is selected.

onDataReturnAppendRows

void onDataReturnAppendRows ( sRequest , oResponse , oPayload )
Callback function receives data from DataSource and appends to an existing DataTable new Records and, if applicable, creates or updates corresponding TR elements.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
oPayload <MIXED> (optional) Additional argument(s)
Returns: void

onDataReturnInitializeTable

void onDataReturnInitializeTable ( sRequest , oResponse , oPayload )
Callback function receives data from DataSource and populates an entire DataTable with Records and TR elements, clearing previous Records, if any.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
oPayload <MIXED> (optional) Additional argument(s)
Returns: void

onDataReturnInsertRows

void onDataReturnInsertRows ( sRequest , oResponse , oPayload )
Callback function receives data from DataSource and inserts new records starting at the index specified in oPayload.insertIndex. If applicable, creates or updates corresponding TR elements.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
oPayload <MIXED> (optional) Additional argument(s)
Returns: void

onDataReturnReplaceRows

void onDataReturnReplaceRows ( )
Returns: void
Deprecated Use onDataReturnInitializeTable.

onDataReturnSetRecords

void onDataReturnSetRecords ( oRequest , oResponse , oPayload )
Receives reponse from DataSource and populates the RecordSet with the results.
Parameters:
oRequest <MIXED> Original generated request.
oResponse <Object> Response object.
oPayload <MIXED> (optional) Additional argument(s)
Returns: void

onEventCancelCellEditor

void onEventCancelCellEditor ( oArgs.editor )
Overridable custom event handler to cancel Cell Editor.
Parameters:
oArgs.editor <Object> Cell Editor object literal.
Returns: void

onEventEditCell

void onEventEditCell ( )
Returns: void
Deprecated Use onEventShowCellEditor.

onEventFormatCell

void onEventFormatCell ( oArgs.event , oArgs.target )
Overridable custom event handler to format cell.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventHighlightCell

void onEventHighlightCell ( oArgs.event , oArgs.target )
Overridable custom event handler to highlight cell. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventHighlightColumn

void onEventHighlightColumn ( oArgs.event , oArgs.target )
Overridable custom event handler to highlight Column. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventHighlightRow

void onEventHighlightRow ( oArgs.event , oArgs.target )
Overridable custom event handler to highlight row. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventSaveCellEditor

void onEventSaveCellEditor ( oArgs.editor )
Overridable custom event handler to save Cell Editor input.
Parameters:
oArgs.editor <Object> Cell Editor object literal.
Returns: void

onEventSelectCell

void onEventSelectCell ( oArgs.event , oArgs.target )
Overridable custom event handler to select cell.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventSelectColumn

void onEventSelectColumn ( oArgs.event , oArgs.target )
Overridable custom event handler to select Column.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventSelectRow

void onEventSelectRow ( oArgs.event , oArgs.target )
Overridable custom event handler to manage selection according to desktop paradigm.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventShowCellEditor

void onEventShowCellEditor ( oArgs.event , oArgs.target )
Overridable custom event handler to edit cell.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventSortColumn

void onEventSortColumn ( oArgs.event , oArgs.target )
Overridable custom event handler to sort Column.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventUnhighlightCell

void onEventUnhighlightCell ( oArgs.event , oArgs.target )
Overridable custom event handler to unhighlight cell. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventUnhighlightColumn

void onEventUnhighlightColumn ( oArgs.event , oArgs.target )
Overridable custom event handler to unhighlight Column. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onEventUnhighlightRow

void onEventUnhighlightRow ( oArgs.event , oArgs.target )
Overridable custom event handler to unhighlight row. Accounts for spurious caused-by-child events.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

onPaginatorChange

void onPaginatorChange ( an )
Delegates the Pag changeRequest events to the configured handler.
Parameters:
an <Object> object literal describing the proposed pagination state
Returns: void

refreshView

void refreshView ( )
Returns: void
Deprecated Use render.

removeColumn

YAHOO.widget.Column removeColumn ( oColumn )
Removes given Column. NOTE: You cannot remove nested Columns. You can only remove non-nested Columns, and top-level parent Columns (which will remove all children Columns).
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
Returns: YAHOO.widget.Column
oColumn Removed Column instance.

render

void render ( )
Renders the view with existing Records from the RecordSet while maintaining sort, pagination, and selection states. For performance, reuses existing DOM elements when possible while deleting extraneous elements.
Returns: void

resetCellEditor

void resetCellEditor ( )
Clears Cell Editor of all state and UI.
Returns: void

saveCellEditor

void saveCellEditor ( )
Saves Cell Editor input to Record.
Returns: void

select

void select ( )
Returns: void
Deprecated Use selectRow.

selectCell

void selectCell ( cell )
Sets given cell to the selected state.
Parameters:
cell <HTMLElement | String> DOM element reference or ID string to DataTable page element or RecordSet index.
Returns: void

selectColumn

void selectColumn ( column )
Selects given Column. NOTE: You cannot select/unselect nested Columns. You can only select/unselect non-nested Columns, and bottom-level key Columns.
Parameters:
column <HTMLElement | String | Number> DOM reference or ID string to a TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: void

selectRow

void selectRow ( row )
Sets given row to the selected state.
Parameters:
row <HTMLElement | String | YAHOO.widget.Record | Number> HTML element reference or ID string, Record instance, or RecordSet position index.
Returns: void

setColumnWidth

void setColumnWidth ( oColumn , nWidth )
Sets given Column to given pixel width. If new width is less than minimum width, sets to minimum width. Updates oColumn.width value.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
nWidth <Number> New width in pixels.
Returns: void

showCellEditor

void showCellEditor ( elCell , oRecord , oColumn )
Shows Cell Editor for given cell.
Parameters:
elCell <HTMLElement | String> Cell to edit.
oRecord <YAHOO.widget.Record> (Optional) Record instance.
oColumn <YAHOO.widget.Column> (Optional) Column instance.
Returns: void

showCellEditorBtns

void showCellEditorBtns ( elContainer )
Adds Save/Cancel buttons to Cell Editor.
Parameters:
elContainer <HTMLElement> Cell Editor container.
Returns: void

showColumn

void showColumn ( oColumn )
Shows given Column. NOTE: You cannot hide/show nested Columns. You can only hide/show non-nested Columns, and top-level parent Columns (which will hide/show all children Columns).
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
Returns: void

showPage

void showPage ( )
Returns: void
Deprecated Use Paginator class APIs.

showTableMessage

void showTableMessage ( sHTML , sClassName )
Displays message within secondary TBODY.
Parameters:
sHTML <String> (optional) Value for innerHTMlang.
sClassName <String> (optional) Classname.
Returns: void

sortColumn

void sortColumn ( oColumn , sDir )
Sorts given Column.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
sDir <String> (Optional) DT.CLASS_ASC or DT.CLASS_DESC
Returns: void

toString

String toString ( )
DataSource instance name, for logging.
Returns: String
Unique name of the DataSource instance.

unhighlightCell

void unhighlightCell ( cell )
Removes the class DT.CLASS_HIGHLIGHTED from the given cell.
Parameters:
cell <HTMLElement | String> DOM element reference or ID string.
Returns: void

unhighlightColumn

void unhighlightColumn ( column )
Removes the class DT.CLASS_HIGHLIGHTED to cells of the given Column. NOTE: You cannot highlight/unhighlight nested Columns. You can only highlight/unhighlight non-nested Columns, and bottom-level key Columns.
Parameters:
column <HTMLElement | String | Number> DOM reference or ID string to a TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: void

unhighlightRow

void unhighlightRow ( row )
Removes the class DT.CLASS_HIGHLIGHTED from the given row.
Parameters:
row <HTMLElement | String> DOM element reference or ID string.
Returns: void

unselectAllCells

void unselectAllCells ( )
Clears out all cell selections.
Returns: void

unselectAllRows

void unselectAllRows ( )
Clears out all row selections.
Returns: void

unselectCell

void unselectCell ( cell )
Sets given cell to the unselected state.
Parameters:
cell <HTMLElement | String> DOM element reference or ID string to DataTable page element or RecordSet index.
Returns: void

unSelectColumn

void unSelectColumn ( column )
Unselects given Column. NOTE: You cannot select/unselect nested Columns. You can only select/unselect non-nested Columns, and bottom-level key Columns.
Parameters:
column <HTMLElement | String | Number> DOM reference or ID string to a TH/TD element (or child of a TH/TD element), a Column key, or a ColumnSet key index.
Returns: void

unselectRow

void unselectRow ( row )
Sets given row to the selected state.
Parameters:
row <HTMLElement | String | YAHOO.widget.Record | Number> HTML element reference or ID string, Record instance, or RecordSet position index.
Returns: void

updatePaginator

void updatePaginator ( )
Returns: void
Deprecated Use Paginator class APIs.

updateRow

void updateRow ( row , oData )
For the given row, updates the associated Record with the given data. If the row is on current page, the corresponding DOM elements are also updated.
Parameters:
row <YAHOO.widget.Record | Number | HTMLElement | String> Which row to update: By Record instance, by Record's RecordSet position index, by HTMLElement reference to the TR element, or by ID string of the TR element.
oData <Object> Object literal of data for the row.
Returns: void

Events

beforeCaptionChange

beforeCaptionChange ( eventInfo )
Fires before the value for the configuration attribute 'caption' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeDraggablecolumnsChange

beforeDraggablecolumnsChange ( eventInfo )
Fires before the value for the configuration attribute 'draggableColumns' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeGeneraterequestChange

beforeGeneraterequestChange ( eventInfo )
Fires before the value for the configuration attribute 'generateRequest' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeHeightChange

beforeHeightChange ( eventInfo )
Fires before the value for the configuration attribute 'height' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeInitialloadChange

beforeInitialloadChange ( eventInfo )
Fires before the value for the configuration attribute 'initialLoad' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeInitialrequestChange

beforeInitialrequestChange ( eventInfo )
Fires before the value for the configuration attribute 'initialRequest' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforePaginatedChange

beforePaginatedChange ( eventInfo )
Fires before the value for the configuration attribute 'paginated' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforePaginationeventhandlerChange

beforePaginationeventhandlerChange ( eventInfo )
Fires before the value for the configuration attribute 'paginationEventHandler' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforePaginatorChange

beforePaginatorChange ( eventInfo )
Fires before the value for the configuration attribute 'paginator' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeRenderloopsizeChange

beforeRenderloopsizeChange ( eventInfo )
Fires before the value for the configuration attribute 'renderLoopSize' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeScrollableChange

beforeScrollableChange ( eventInfo )
Fires before the value for the configuration attribute 'scrollable' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeSelectionmodeChange

beforeSelectionmodeChange ( eventInfo )
Fires before the value for the configuration attribute 'selectionMode' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeSortedbyChange

beforeSortedbyChange ( eventInfo )
Fires before the value for the configuration attribute 'sortedBy' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeSummaryChange

beforeSummaryChange ( eventInfo )
Fires before the value for the configuration attribute 'summary' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

beforeWidthChange

beforeWidthChange ( eventInfo )
Fires before the value for the configuration attribute 'width' changes. Return false to cancel the attribute change.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the current attribute value and the new value.

buttonClickEvent

buttonClickEvent ( oArgs.event , oArgs.target )
Fired when a BUTTON element is clicked.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The BUTTON element.

captionChange

captionChange ( eventInfo )
Fires when the value for the configuration attribute 'caption' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

cellClickEvent

cellClickEvent ( oArgs.event , oArgs.target )
Fired when a cell has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TD element.

cellDblclickEvent

cellDblclickEvent ( oArgs.event , oArgs.target )
Fired when a cell has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TD element.

cellFormatEvent

cellFormatEvent ( oArgs.el , oArgs.record , oArgs.column , oArgs.key )
Fired when a cell is formatted.
Parameters:
oArgs.el <HTMLElement> The formatted TD element.
oArgs.record <YAHOO.widget.Record> The associated Record instance.
oArgs.column <YAHOO.widget.Column> The associated Column instance.
oArgs.key <String> (deprecated) The key of the formatted cell.

cellHighlightEvent

cellHighlightEvent ( oArgs.el , oArgs.record , oArgs.column , oArgs.key )
Fired when a cell is highlighted.
Parameters:
oArgs.el <HTMLElement> The highlighted TD element.
oArgs.record <YAHOO.widget.Record> The associated Record instance.
oArgs.column <YAHOO.widget.Column> The associated Column instance.
oArgs.key <String> (deprecated) The key of the highlighted cell.

cellMousedownEvent

cellMousedownEvent ( oArgs.event , oArgs.target )
Fired when a cell has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TD element.

cellMouseoutEvent

cellMouseoutEvent ( oArgs.event , oArgs.target )
Fired when a cell has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TD element.

cellMouseoverEvent

cellMouseoverEvent ( oArgs.event , oArgs.target )
Fired when a cell has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TD element.

cellSelectEvent

cellSelectEvent ( oArgs.el , oArgs.record , oArgs.column , oArgs.key )
Fired when a cell is selected.
Parameters:
oArgs.el <HTMLElement> The selected TD element.
oArgs.record <YAHOO.widget.Record> The associated Record instance.
oArgs.column <YAHOO.widget.Column> The associated Column instance.
oArgs.key <String> (deprecated) The key of the selected cell.

cellUnhighlightEvent

cellUnhighlightEvent ( oArgs.el , oArgs.record , oArgs.column , oArgs.key )
Fired when a cell is unhighlighted.
Parameters:
oArgs.el <HTMLElement> The unhighlighted TD element.
oArgs.record <YAHOO.widget.Record> The associated Record instance.
oArgs.column <YAHOO.widget.Column> The associated Column instance.
oArgs.key <String> (deprecated) The key of the unhighlighted cell.

cellUnselectEvent

cellUnselectEvent ( oArgs.el , oArgs.record , oArgs.column , oArgs.key )
Fired when a cell is unselected.
Parameters:
oArgs.el <HTMLElement> The unselected TD element.
oArgs.record <YAHOO.widget.Record> The associated Record.
oArgs.column <YAHOO.widget.Column> The associated Column instance.
oArgs.key <String> (deprecated) The key of the unselected cell.

checkboxClickEvent

checkboxClickEvent ( oArgs.event , oArgs.target )
Fired when a CHECKBOX element is clicked.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The CHECKBOX element.

columnHideEvent

columnHideEvent ( oArgs.column )
Fired when a column is hidden.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.

columnHighlightEvent

columnHighlightEvent ( oArgs.column )
Fired when a column is highlighted.
Parameters:
oArgs.column <YAHOO.widget.Column> The highlighted Column.

columnInsertEvent

columnInsertEvent ( oArgs.column , oArgs.index )
Fired when a column is inserted.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.
oArgs.index <Number> The index position.

columnRemoveEvent

columnRemoveEvent ( oArgs.column )
Fired when a column is removed.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.

columnResizeEvent

columnResizeEvent ( oArgs.column , oArgs.target )
Fired when a column is drag-resized.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.
oArgs.target <HTMLElement> The TH element.

columnSelectEvent

columnSelectEvent ( oArgs.column )
Fired when a column is selected.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.

columnSetWidthEvent

columnSetWidthEvent ( oArgs.column , oArgs.width )
Fired when a column width is set.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.
oArgs.width <Number> The width in pixels.

columnShowEvent

columnShowEvent ( oArgs.column )
Fired when a column is shown.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.

columnSortEvent

columnSortEvent ( oArgs.column , oArgs.dir )
Fired when a column is sorted.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.
oArgs.dir <String> Sort direction: YAHOO.widget.DataTable.CLASS_ASC or YAHOO.widget.DataTable.CLASS_DESC.

columnUnhighlightEvent

columnUnhighlightEvent ( oArgs.column )
Fired when a column is unhighlighted.
Parameters:
oArgs.column <YAHOO.widget.Column> The unhighlighted Column.

columnUnselectEvent

columnUnselectEvent ( oArgs.column )
Fired when a column is unselected.
Parameters:
oArgs.column <YAHOO.widget.Column> The Column instance.

dataReturnEvent

dataReturnEvent ( oArgs.request , oArgs.response )
Fired when data is returned from DataSource but before it is consumed by DataTable.
Parameters:
oArgs.request <String> Original request.
oArgs.response <Object> Response object.

draggableColumnsChange

draggableColumnsChange ( eventInfo )
Fires when the value for the configuration attribute 'draggableColumns' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

editorBlurEvent

editorBlurEvent ( oArgs.editor )
Fired when an active Editor has a blur.
Parameters:
oArgs.editor <Object> The Editor object literal.

editorCancelEvent

editorCancelEvent ( oArgs.editor )
Fired when Editor input is canceled.
Parameters:
oArgs.editor <Object> The Editor object literal.

editorKeydownEvent

editorKeydownEvent ( oArgs.editor , oArgs.event )
Fired when an active Editor has a keydown.
Parameters:
oArgs.editor <Object> The Editor object literal.
oArgs.event <HTMLEvent> The event object.

editorRevertEvent

editorRevertEvent ( oArgs.editor , oArgs.newData , oArgs.oldData )
Fired when Editor input is reverted.
Parameters:
oArgs.editor <Object> The Editor object literal.
oArgs.newData <Object> New data value from form input field.
oArgs.oldData <Object> Old data value.

editorSaveEvent

editorSaveEvent ( oArgs.editor , oArgs.newData , oArgs.oldData )
Fired when Editor input is saved.
Parameters:
oArgs.editor <Object> The Editor object literal.
oArgs.newData <Object> New data value from form input field.
oArgs.oldData <Object> Old data value.

editorShowEvent

editorShowEvent ( oArgs.editor )
Fired when an Editor is activated.
Parameters:
oArgs.editor <Object> The Editor object literal.

generateRequestChange

generateRequestChange ( eventInfo )
Fires when the value for the configuration attribute 'generateRequest' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

headerCellClickEvent

headerCellClickEvent ( )
Deprecated Use theadCellClickEvent.

headerCellDblclickEvent

headerCellDblclickEvent ( )
Deprecated Use theadCellDblclickEvent.

headerCellMousedownEvent

headerCellMousedownEvent ( )
Deprecated Use theadCellMousedownEvent.

headerCellMouseoutEvent

headerCellMouseoutEvent ( )
Deprecated Use theadCellMouseoutEvent.

headerCellMouseoverEvent

headerCellMouseoverEvent ( )
Deprecated Use theadCellMouseoverEvent.

headerLabelClickEvent

headerLabelClickEvent ( )
Deprecated Use theadLabelClickEvent.

headerLabelDbllickEvent

headerLabelDbllickEvent ( )
Deprecated Use theadLabelDblclickEvent.

headerLabelMousedownEvent

headerLabelMousedownEvent ( )
Deprecated Use theadLabelMousedownEvent.

headerLabelMouseoutEvent

headerLabelMouseoutEvent ( )
Deprecated Use theadLabelMouseoutEvent.

headerLabelMouseoverEvent

headerLabelMouseoverEvent ( )
Deprecated Use theadLabelMouseoverEvent.

headerRowClickEvent

headerRowClickEvent ( )
Deprecated Use theadRowClickEvent.

headerRowDblclickEvent

headerRowDblclickEvent ( )
Deprecated Use theadRowDblclickEvent.

headerRowMousedownEvent

headerRowMousedownEvent ( )
Deprecated Use theadRowMousedownEvent.

headerRowMouseoutEvent

headerRowMouseoutEvent ( )
Deprecated Use theadRowMouseoutEvent.

headerRowMouseoverEvent

headerRowMouseoverEvent ( )
Deprecated Use theadRowMouseoverEvent.

heightChange

heightChange ( eventInfo )
Fires when the value for the configuration attribute 'height' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

initEvent

initEvent ( )
Fired when the DataTable instance's initialization is complete.

initialLoadChange

initialLoadChange ( eventInfo )
Fires when the value for the configuration attribute 'initialLoad' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

initialRequestChange

initialRequestChange ( eventInfo )
Fires when the value for the configuration attribute 'initialRequest' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

linkClickEvent

linkClickEvent ( oArgs.event , oArgs.target )
Fired when a link is clicked.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The A element.

paginatedChange

paginatedChange ( eventInfo )
Fires when the value for the configuration attribute 'paginated' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

paginationEventHandlerChange

paginationEventHandlerChange ( eventInfo )
Fires when the value for the configuration attribute 'paginationEventHandler' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

paginatorChange

paginatorChange ( eventInfo )
Fires when the value for the configuration attribute 'paginator' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

radioClickEvent

radioClickEvent ( oArgs.event , oArgs.target )
Fired when a RADIO element is clicked.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The RADIO element.

renderEvent

renderEvent ( )
Fired when the DataTable's view is rendered.

renderLoopSizeChange

renderLoopSizeChange ( eventInfo )
Fires when the value for the configuration attribute 'renderLoopSize' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

rowAddEvent

rowAddEvent ( oArgs.record )
Fired when a row is added.
Parameters:
oArgs.record <YAHOO.widget.Record> The added Record.

rowClickEvent

rowClickEvent ( oArgs.event , oArgs.target )
Fired when a row has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

rowDblclickEvent

rowDblclickEvent ( oArgs.event , oArgs.target )
Fired when a row has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

rowDeleteEvent

rowDeleteEvent ( oArgs.oldData , oArgs.recordIndex , oArgs.trElIndex )
Fired when a row is deleted.
Parameters:
oArgs.oldData <Object> Object literal of the deleted data.
oArgs.recordIndex <Number> Index of the deleted Record.
oArgs.trElIndex <Number> Index of the deleted TR element, if on current page.

rowHighlightEvent

rowHighlightEvent ( oArgs.el , oArgs.record )
Fired when a row is highlighted.
Parameters:
oArgs.el <HTMLElement> The highlighted TR element.
oArgs.record <YAHOO.widget.Record> The highlighted Record.

rowMousedownEvent

rowMousedownEvent ( oArgs.event , oArgs.target )
Fired when a row has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

rowMouseoutEvent

rowMouseoutEvent ( oArgs.event , oArgs.target )
Fired when a row has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

rowMouseoverEvent

rowMouseoverEvent ( oArgs.event , oArgs.target )
Fired when a row has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

rowSelectEvent

rowSelectEvent ( oArgs.el , oArgs.record )
Fired when a row is selected.
Parameters:
oArgs.el <HTMLElement> The selected TR element, if applicable.
oArgs.record <YAHOO.widget.Record> The selected Record.

rowUnhighlightEvent

rowUnhighlightEvent ( oArgs.el , oArgs.record )
Fired when a row is unhighlighted.
Parameters:
oArgs.el <HTMLElement> The highlighted TR element.
oArgs.record <YAHOO.widget.Record> The highlighted Record.

rowUnselectEvent

rowUnselectEvent ( oArgs.el , oArgs.record )
Fired when a row is unselected.
Parameters:
oArgs.el <HTMLElement> The unselected TR element, if applicable.
oArgs.record <YAHOO.widget.Record> The unselected Record.

rowUpdateEvent

rowUpdateEvent ( oArgs.record , oArgs.oldData )
Fired when a row is updated.
Parameters:
oArgs.record <YAHOO.widget.Record> The updated Record.
oArgs.oldData <Object> Object literal of the old data.

scrollableChange

scrollableChange ( eventInfo )
Fires when the value for the configuration attribute 'scrollable' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

selectionModeChange

selectionModeChange ( eventInfo )
Fires when the value for the configuration attribute 'selectionMode' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

sortedByChange

sortedByChange ( eventInfo )
Fires when the value for the configuration attribute 'sortedBy' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

summaryChange

summaryChange ( eventInfo )
Fires when the value for the configuration attribute 'summary' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

tableBlurEvent

tableBlurEvent ( )
Fired when the DataTable has a blur event.

tableClickEvent

tableClickEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableDblclickEvent

tableDblclickEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableFocusEvent

tableFocusEvent ( )
Fired when the DataTable has a focus event.

tableKeyEvent

tableKeyEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a key event.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableMousedownEvent

tableMousedownEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableMouseoutEvent

tableMouseoutEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableMouseoverEvent

tableMouseoverEvent ( oArgs.event , oArgs.target )
Fired when the DataTable has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

tableMsgHideEvent

tableMsgHideEvent ( )
Fired when the DataTable's message element is hidden.

tableMsgShowEvent

tableMsgShowEvent ( oArgs.html , oArgs.className )
Fired when a message is shown in the DataTable's message element.
Parameters:
oArgs.html <String> The HTML displayed.
oArgs.className <String> The className assigned.

tableScrollEvent

tableScrollEvent ( oArgs.event , oArgs.target )
Fired when a fixed scrolling DataTable has a scroll.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's CONTAINER element (in IE) or the DataTable's TBODY element (everyone else).

tbodyFocusEvent

tbodyFocusEvent ( )
Fired when the DataTable TBODY element has a focus event.

tbodyKeyEvent

tbodyKeyEvent ( oArgs.event , oArgs.target )
Fired when the DataTable TBODY element has a key event.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

theadCellClickEvent

theadCellClickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD cell has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TH element.

theadCellDblclickEvent

theadCellDblclickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD cell has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TH element.

theadCellMousedownEvent

theadCellMousedownEvent ( oArgs.event , oArgs.target )
Fired when a THEAD cell has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TH element.

theadCellMouseoutEvent

theadCellMouseoutEvent ( oArgs.event , oArgs.target )
Fired when a THEAD cell has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TH element.

theadCellMouseoverEvent

theadCellMouseoverEvent ( oArgs.event , oArgs.target )
Fired when a THEAD cell has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TH element.

theadFocusEvent

theadFocusEvent ( )
Fired when the DataTable THEAD element has a focus event.

theadKeyEvent

theadKeyEvent ( oArgs.event , oArgs.target )
Fired when the DataTable THEAD element has a key event.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The DataTable's TABLE element.

theadLabelClickEvent

theadLabelClickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD label has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The SPAN element.

theadLabelDblclickEvent

theadLabelDblclickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD label has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The SPAN element.

theadLabelMousedownEvent

theadLabelMousedownEvent ( oArgs.event , oArgs.target )
Fired when a THEAD label has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The SPAN element.

theadLabelMouseoutEvent

theadLabelMouseoutEvent ( oArgs.event , oArgs.target )
Fired when a THEAD label has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The SPAN element.

theadLabelMouseoverEvent

theadLabelMouseoverEvent ( oArgs.event , oArgs.target )
Fired when a THEAD label has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The SPAN element.

theadRowClickEvent

theadRowClickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD row has a click.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

theadRowDblclickEvent

theadRowDblclickEvent ( oArgs.event , oArgs.target )
Fired when a THEAD row has a dblclick.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

theadRowMousedownEvent

theadRowMousedownEvent ( oArgs.event , oArgs.target )
Fired when a THEAD row has a mousedown.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

theadRowMouseoutEvent

theadRowMouseoutEvent ( oArgs.event , oArgs.target )
Fired when a THEAD row has a mouseout.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

theadRowMouseoverEvent

theadRowMouseoverEvent ( oArgs.event , oArgs.target )
Fired when a THEAD row has a mouseover.
Parameters:
oArgs.event <HTMLEvent> The event object.
oArgs.target <HTMLElement> The TR element.

unselectAllCellsEvent

unselectAllCellsEvent ( )
Fired when all cell selections are cleared.

unselectAllRowsEvent

unselectAllRowsEvent ( )
Fired when all row selections are cleared.

widthChange

widthChange ( eventInfo )
Fires when the value for the configuration attribute 'width' changes.
Parameters:
eventInfo <{oldValue: any, newValue: any}> An object containing the previous attribute value and the new value.

Configuration Attributes

caption - String

Value for the CAPTION element.

draggableColumns - Boolean

True if Columns are draggable to reorder, false otherwise. The Drag & Drop Utility is required to enable this feature. Only top-level and non-nested Columns are draggable. Write once.
Default Value: false

generateRequest - function

A function used to translate proposed DataTable state info into a value which is then passed to the DataSource's sendRequest method. This function is called to get the DataTable's initial data as well as any data changes or requests such as pagination or sorting. The method is passed two params, an object literal with the state data and a reference to the DataTable.
Default Value: DT._generateRequest

height - String

Table height for scrollable tables

initialLoad - Boolean | Object

Determines whether or not to load data at instantiation. By default, will trigger a sendRequest() to the DataSource and pass in the request defined by initialRequest. If set to false, data will not load at instantiation. Alternatively, implementers who wish to work with a custom payload may pass in an object literal with the following values:
request (MIXED)
Request value.
argument (MIXED)
Custom data that will be passed through to the callback function.
Default Value: true

initialRequest - MIXED

Defines the initial request that gets sent to the DataSource during initialization. Value is ignored if initialLoad is set to any value other than true.
Default Value: null

paginated - object

Deprecated No longer used, as long as "paginator" value is an instance of Paginator class.

paginationEventHandler - {function|Object}

For use with Pag pagination. A handler function that receives the requestChange event from the configured paginator. The handler method will be passed these parameters:
  1. oState {Object} - an object literal describing the requested pagination state
  2. oSelf {DataTable} - The DataTable instance.
For pagination through dynamic or server side data, assign DT.handleDataSourcePagination or your own custom handler.
Default Value: DT.handleSimplePagination

paginator - {Object|YAHOO.widget.Paginator}

Stores an instance of Pag, or (for backward compatibility), an object literal of pagination values in the following form:
{ containers:[], // UI container elements
rowsPerPage:500, // 500 rows
currentPage:1, // page one
pageLinks:0, // show all links
pageLinksStart:1, // first link is page 1
dropdownOptions:null, // no dropdown
links: [], // links elements
dropdowns: [] } //dropdown elements
Default Value: null

renderLoopSize - Number

A value greater than 0 enables DOM rendering of rows to be executed from a non-blocking timeout queue and sets how many rows to be rendered per timeout. Recommended for very large data sets.
Default Value: 0

scrollable - Boolean

True if primary TBODY should scroll.
Default Value: false

selectionMode - String

Specifies row or cell selection mode. Accepts the following strings:
"standard"
Standard row selection with support for modifier keys to enable multiple selections.
"single"
Row selection with modifier keys disabled to not allow multiple selections.
"singlecell"
Cell selection with modifier keys disabled to not allow multiple selections.
"cellblock"
Cell selection with support for modifier keys to enable multiple selections in a block-fashion, like a spreadsheet.
"cellrange"
Cell selection with support for modifier keys to enable multiple selections in a range-fashion, like a calendar.
Default Value: "standard"

sortedBy - Object

Object literal provides metadata for initial sort values if data will arrive pre-sorted:
sortedBy.key
{String} Key of sorted Column
sortedBy.dir
{String} Initial sort direction, either DT.CLASS_ASC or DT.CLASS_DESC

summary - String

Value for the SUMMARY attribute.

width - String

Table width for scrollable tables


Copyright © 2007 Yahoo! Inc. All rights reserved.