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

_aSelections - private Object[]

Array of selections: {recordId:nRecordId, cellIndex:nCellIndex}

_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 the TABLE element gets 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.

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

_nIndex - private Number

Index assigned to instance.

_nTrCount - private Number

Counter for IDs assigned to TR elements.

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

_sFirstLabelLinkId - private String

ID string of first label link element of the current DataTable page, if any. Used for focusing sortable Columns with TAB.

_sFirstTrId - private String

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

_sLastHighlightedCellId - private String

ID string of last highlighted cell element

_sLastHighlightedRowId - private String

ID string of last highlighted row element

_sLastSelectedId - private String

ID string of last selected element

_sLastTrId - private String

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

_sName - private String

Unique name assigned to instance.

_sSelectionAnchorId - private String

ID string of the selection anchor element.

DataTable._nCount - private static Number

Internal class variable for indexing multiple DataTable instances.

DataTable.CLASS_ASC - static final String

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

DataTable.CLASS_BODY - static final String

Class name assigned to the primary TBODY element.
Default Value: "yui-dt-body"

DataTable.CLASS_BUTTON - static final String

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

DataTable.CLASS_CHECKBOX - static final String

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

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_DROPDOWN - static final String

Class name assigned to SELECT 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_HEADER - static final String

Class name assigned to header container elements within each TH element.
Default Value: "yui-dt-header"

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_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_RESIZER - static final String

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

DataTable.CLASS_SCROLLABLE - static final String

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

DataTable.CLASS_SCROLLBODY - static final String

Class name assigned to the scrolling TBODY element of a fixed scrolling DataTable.
Default Value: "yui-dt-scrollbody"

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.CLASS_TABLE - static final String

Class name assigned to TABLE element.
Default Value: "yui-dt-table"

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

_addTrEl

private String _addTrEl ( oRecord , index )
Adds a TR element to the primary TBODY at the page row index if given, otherwise at the end of the page. Formats TD elements within the TR element using data from the given Record.
Parameters:
oRecord <YAHOO.widget.Record> Record instance.
index <Number> (optional) The page row index at which to add the TR element.
Returns: String
ID of the added TR element, or null.

_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

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

_initDomEvents

private void _initDomEvents ( )
Initializes DOM event listeners.
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

_initTheadEl

private void _initTheadEl ( )
Populates THEAD element with TH cells as defined by ColumnSet.
Returns: void

_initThEl

private void _initThEl ( elTheadCell , oColumn , row , col )
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.
Returns: void

_onDataReturnEnhanceTable

private void _onDataReturnEnhanceTable ( sRequest , oResponse , bError )
Callback function for creating a progressively enhanced DataTable first receives data from DataSource and populates the RecordSet, then initializes DOM elements.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
bError <Boolean> (optional) True if there was a data error.
Returns: void

_onDocumentClick

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

_onDocumentKeydown

private void _onDocumentKeydown ( e , oSelf )
Handles keydown events on the DOCUMENT.
Parameters:
e <HTMLEvent> The keydown event.
oSelf <YAHOO.widget.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.widget.DataTable> DataTable instance.
Returns: void

_onPaginatorDropdownChange

private void _onPaginatorDropdownChange ( e , oSelf )
Handles change events on paginator SELECT element.
Parameters:
e <HTMLEvent> The change event.
oSelf <YAHOO.widget.DataTable> DataTable instance.
Returns: void

_onPaginatorLinkClick

private void _onPaginatorLinkClick ( e , oSelf )
Handles click events on paginator links.
Parameters:
e <HTMLEvent> The click event.
oSelf <YAHOO.widget.DataTable> DataTable instance.
Returns: void

_onScroll

private void _onScroll ( e , oSelf )
Handles scroll events on the CONTAINER (for IE) and TBODY elements (for everyone else).
Parameters:
e <HTMLEvent> The scroll event.
oSelf <YAHOO.widget.DataTable> DataTable instance.
Returns: void

_onTableDblclick

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

_onTableFocus

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

_onTableKeydown

private void _onTableKeydown ( e , oSelf )
Handles keydown events on the TABLE element. Handles arrow selection.
Parameters:
e <HTMLEvent> The key event.
oSelf <YAHOO.widget.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.widget.DataTable> DataTable instance.
Returns: void

_onTableMousedown

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

_onTableMouseout

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

_onTableMouseover

private void _onTableMouseover ( e , oSelf )
Handles mouseover events on the TABLE element.
Parameters:
e <HTMLEvent> The mouseover event.
oSelf <YAHOO.widget.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.widget.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.widget.DataTable> DataTable instance.
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 YAHOO.widget.DataTable.CLASS_EVEN and YAHOO.widget.DataTable.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

_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

_updateTrEl

private String _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: String
ID of the updated TR element, or null.

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

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

deleteRow

void deleteRow ( row )
Deletes the given row's Record from the RecordSet. If the row is in view, 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 )
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.
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

editCheckbox

void editCheckbox ( )
Enables CHECKBOX Editor.
Returns: void

editDate

void editDate ( )
Enables Date Editor.
Returns: void

editDropdown

void editDropdown ( )
Enables SELECT Editor.
Returns: void

editRadio

void editRadio ( )
Enables INPUT TYPE=RADIO Editor.
Returns: void

editTextarea

void editTextarea ( )
Enables TEXTAREA Editor.
Returns: void

editTextbox

void editTextbox ( )
Enables INPUT TYPE=TEXT Editor.
Returns: void

focus

void focus ( )
Brings focus to DataTable instance.
Returns: void

formatCell

HTML formatCell ( elCell , oRecord , oColumn )
Outputs markup into the given TD based on given Record.
Parameters:
elCell <HTMLElement> TD Element.
oRecord <YAHOO.widget.Record> (Optional) Record instance.
oColumn <YAHOO.widget.Column> (Optional) Column instance.
Returns: HTML
Markup.

formatPaginatorDropdown

void formatPaginatorDropdown ( elDropdown , dropdownOptions )
Updates Paginator dropdown. If dropdown doesn't exist, the markup is created. Sets dropdown elements's "selected" value.
Parameters:
elDropdown <HTMLElement> The SELECT element.
dropdownOptions <Object[]> OPTION values for display in the SELECT element.
Returns: void

formatPaginatorLinks

void formatPaginatorLinks ( elContainer , nCurrentPage , nPageLinksStart , nPageLinksLength , nTotalPages )
Updates Paginator links container with markup.
Parameters:
elContainer <HTMLElement> The link container element.
nCurrentPage <Number> Current page.
nPageLinksStart <Number> First page link to display.
nPageLinksLength <Number> How many page links to display.
nTotalPages <Number> Total number of pages.
Returns: void

formatPaginators

void formatPaginators ( )
Updates Paginator containers with markup. Override this method to customize pagination UI.
Returns: void

getCellEditor

Object getCellEditor ( )
Returns the DataTable instance's Cell Editor as an object literal with the following properties:
cell
Cell element being edited
column
Associated Column instance
container
Reference to editor's container DIV element
isActive
True if cell is currently being edited
record
Associated Record instance
validator
Associated validator function
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.
Parameters:
column <HTMLElement | String | Number> ColumnSet.keys position index, DOM reference or ID string to an element within the DataTable page.
Returns: YAHOO.widget.Column
Column instance.

getColumnSet

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

getDataSource

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

getFirstTrEl

HTMLElement getFirstTrEl ( )
Returns DOM reference to the first TR element in the DataTable page, or null.
Returns: HTMLElement
Reference to TR 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.

getRecord

YAHOO.widget.Record getRecord ( row )
For the given identifier, returns the associated Record instance.
Parameters:
row <HTMLElement | String | Number> RecordSet position index, DOM reference or ID string to an element within the DataTable page.
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.

getSelectedCells

HTMLElement[] getSelectedCells ( )
Returns selected cells as an array of object literals: {recordId:nRecordID, columnId:nColumnId}.
Returns: HTMLElement[]
Array of selected cells by Record and Column IDs.

getSelectedRows

HTMLElement[] getSelectedRows ( )
Returns selected rows as an array of Record IDs.
Returns: HTMLElement[]
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.

getTableEl

HTMLElement getTableEl ( )
Returns DOM reference to the DataTable's TABLE element.
Returns: HTMLElement
Reference to TABLE element.

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 the given TD element.
Parameters:
cell <HTMLElement | String> DOM element reference or string ID.
Returns: HTMLElement
Reference to TD element.

getTheadEl

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

getThEl

HTMLElement getThEl ( header )
Returns DOM reference to the TH element at given DataTable page coordinates, or null.
Parameters:
header <HTMLElement | String | YAHOO.widget.Column> DOM element reference or string ID, or Column instance.
Returns: HTMLElement
Reference to TH 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 in view 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 in view.

hideTableMessage

void hideTableMessage ( )
Hides secondary TBODY.
Returns: void

highlightCell

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

highlightRow

void highlightRow ( row )
Assigns the class YAHOO.widget.DataTable.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 ( oData )
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.
Parameters:
oData <Object | Object[]> An object literal of data or an array of object literals containing data.
Returns: void

isSelected

Boolean isSelected ( el )
Returns true if given TR or TD element is select, false otherwise.
Parameters:
el <HTMLElement> HTML element reference or ID of a TR or TD.
Returns: Boolean
True if element is selected.

onDataReturnAppendRows

void onDataReturnAppendRows ( sRequest , oResponse , bError )
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.
bError <Boolean> (optional) True if there was a data error.
Returns: void

onDataReturnInitializeTable

void onDataReturnInitializeTable ( sRequest , oResponse , bError )
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.
bError <Boolean> (optional) True if there was a data error.
Returns: void

onDataReturnInsertRows

void onDataReturnInsertRows ( sRequest , oResponse , bError )
Callback function receives data from DataSource and inserts into top of an existing DataTable new Records and, if applicable, creates or updates corresponding TR elements.
Parameters:
sRequest <String> Original request.
oResponse <Object> Response object.
bError <Boolean> (optional) True if there was a data error.
Returns: void

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

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.
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.
Parameters:
oArgs.event <HTMLEvent> Event object.
oArgs.target <HTMLElement> Target element.
Returns: void

refreshView

void refreshView ( )
Refreshes 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

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

selectRow

void selectRow ( row )
Sets given row to the selected state.
Parameters:
row <HTMLElement | String> HTML element reference or ID.
Returns: void

showCellEditor

void showCellEditor ( elCell , oRecord , oColumn )
Shows Cell Editor for given cell.
Parameters:
elCell <HTMLElement | String> Cell element 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

showPage

void showPage ( nPage )
Displays given page of a paginated DataTable.
Parameters:
nPage <Number> Which page.
Returns: void

showTableMessage

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

sortColumn

void sortColumn ( oColumn )
Sorts given Column.
Parameters:
oColumn <YAHOO.widget.Column> Column instance.
Returns: void

toString

String toString ( )
Public accessor to the unique name of the DataSource instance.
Returns: String
Unique name of the DataSource instance.

unhighlightCell

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

unhighlightRow

void unhighlightRow ( row )
Removes the class YAHOO.widget.DataTable.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

unselectRow

void unselectRow ( row )
Sets given row to the unselected state.
Parameters:
row <HTMLElement | String> HTML TR element reference or ID.
Returns: void

updatePaginator

void updatePaginator ( oNewValues , Object )
Updates Paginator values in response to RecordSet changes and/or DOM events. Pass in all, a subset, or no values.
Parameters:
oNewValues <Object> (Optional) Object literal of Paginator values, or a subset of Paginator values.
Object <Object> literal of all Paginator values.
Returns: void

updateRow

void updateRow ( row , oData )
For the given row, updates the associated Record with the given data. If the row is in view, 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

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.

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.key )
Fired when a cell is formatted.
Parameters:
oArgs.el <HTMLElement> The formatted TD element.
oArgs.record <YAHOO.widget.Record> The formatted Record.
oArgs.key <String> The key of the formatted cell.

cellHighlightEvent

cellHighlightEvent ( oArgs.el , oArgs.record , oArgs.key )
Fired when a cell is highlighted.
Parameters:
oArgs.el <HTMLElement> The highlighted TD element.
oArgs.record <YAHOO.widget.Record> The highlighted Record.
oArgs.key <String> 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.key )
Fired when a cell is selected.
Parameters:
oArgs.el <HTMLElement> The selected TD element.
oArgs.record <YAHOO.widget.Record> The selected Record.
oArgs.key <String> The key of the selected cell.

cellUnhighlightEvent

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

cellUnselectEvent

cellUnselectEvent ( oArgs.el , oArgs.record , oArgs.key )
Fired when a cell is unselected.
Parameters:
oArgs.el <HTMLElement> The unselected TD element.
oArgs.record <YAHOO.widget.Record> The unselected Record.
oArgs.key <String> 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.

columnResizeEvent

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

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 "asc" or "desc".

dataReturnEvent

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

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.
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.
oArgs.oldData <Object> Old data value.

editorShowEvent

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

headerCellClickEvent

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

headerCellDblclickEvent

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

headerCellMousedownEvent

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

headerCellMouseoutEvent

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

headerCellMouseoverEvent

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

headerLabelClickEvent

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

headerLabelDblclickEvent

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

headerLabelMousedownEvent

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

headerLabelMouseoutEvent

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

headerLabelMouseoverEvent

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

headerRowClickEvent

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

headerRowDblclickEvent

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

headerRowMousedownEvent

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

headerRowMouseoutEvent

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

headerRowMouseoverEvent

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

initEvent

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

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.

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.

refreshEvent

refreshEvent ( )
Fired when the DataTable's view is refreshed.

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

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.

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.

tableBlurEvent

tableBlurEvent ( )
Fired when the DataTable has a blur.

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.

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

Configuration Attributes

caption - String

Value for the CAPTION element.

initialRequest - String

Defines the initial request that gets sent to the DataSource.

paginated - Boolean

True if built-in client-side pagination is enabled
Default Value: false

paginator - Object

Object literal of pagination values.
Default Value:
{ 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

scrollable - Boolean

True if primary TBODY should scroll while THEAD remains fixed. When enabling this feature, captions cannot be used, and the following features are not recommended: inline editing, resizeable columns.
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
Key of sorted Column
sortedBy.dir
Initial sort direction, either "asc" or "desc"

summary - String

Value for the SUMMARY attribute.


Copyright © 2007 Yahoo! Inc. All rights reserved.