Class ResultsTable
The ResultsTable object, a displayable table with optional paging
Defined in: resultsTable.js.
Constructor Attributes | Constructor Name and Description |
---|---|
ResultsTable(tag)
|
Method Attributes | Method Name and Description |
---|---|
Adds a header to the table.
|
|
addHeaderStrings(sa)
Adds a header to the table.
|
|
addRow()
Adds a data row to the table.
|
|
addRowStrings(sa)
Adds a data row to the table.
|
|
appendTo(parent)
appends the table and page block to a parent node
|
|
enablePaging(listener)
Turn paging on for this object
|
|
Return the currently displayed page number.
|
|
getRowData(row)
Get the contents of one row
|
|
getRows()
Get the number of rows in the table
|
|
getValue(row, col)
Get the contents of one table element
|
|
Make this table sortable - must be called after table has its contents
Although most of the code for this method is original, many of the design ideas were inspired
by examples at http://www.webtoolkit.info/, and much credit is due to the author(s) of that site.
|
|
nextPage()
Display the next page of the table; called from event listener.
|
|
prevPage()
Display the previous page of the table; called from event listener.
|
|
setClass(clinfo)
Assigns a CSS class to the table
|
|
setPageSize(sz)
Set the number of table rows per page
|
Method Detail
addHeader()
Adds a header to the table. Uses the anonymous argument array as input, so no declared args.
addHeaderStrings(sa)
Adds a header to the table. Uses an explicit array
- Parameters:
- {array} sa
- Array of strings to be used as header items.
addRow()
Adds a data row to the table. Uses the anonymous argument array as input, so no declared args.
myTable.addRow('ken','707-555-1212','ken@calast.com');
addRowStrings(sa)
Adds a data row to the table. Used when you want to pass an existing array of strings.
myTable.addRow(myStringArray);
- Parameters:
- {array} sa
- Array of strings to be used as data items.
appendTo(parent)
appends the table and page block to a parent node
- Parameters:
- {DOM element} parent
- The DOM node to which this is added
enablePaging(listener)
Turn paging on for this object
- Parameters:
- {function} listener
- An event listener to be called when user clicks on prev and next buttons
{number}
getCurrentPage()
Return the currently displayed page number.
- Returns:
- {number} The current page number
{array}
getRowData(row)
Get the contents of one row
- Parameters:
- {number} row
- The row of interest
- Returns:
- {array} The 'td' values in that row
{number}
getRows()
Get the number of rows in the table
- Returns:
- {number} The row count
{array}
getValue(row, col)
Get the contents of one table element
- Returns:
- {array} The 'td' values at that row and column
makeSortable()
Make this table sortable - must be called after table has its contents
Although most of the code for this method is original, many of the design ideas were inspired
by examples at http://www.webtoolkit.info/, and much credit is due to the author(s) of that site.
nextPage()
Display the next page of the table; called from event listener.
prevPage()
Display the previous page of the table; called from event listener.
setClass(clinfo)
Assigns a CSS class to the table
- Parameters:
- {string} clinfo
- The CSS class to assign to the table's class attribute
setPageSize(sz)
Set the number of table rows per page
- Parameters:
- {number} sz
- The number of rows per page