PHP2Go Javascript Framework

Class DataTable

Object
   |
   +--Widget
         |
         +--DataTable

class DataTable
extends Widget

Defined in widgets/datatable.js


Field Summary
 Object anchor
          Current anchor row
 Boolean desc
          Current order direction (true=descending, false=ascending)
 Object root
          Reference to the widget's root node
 Array selected
          Current selected rows
 Number sortIdx
          Current sort column index
 Object sortTypes
          Sort types
 Object table
          Reference to the modified table
 Object tbody
          Reference to the table body
 Object thead
          Reference to the table head
<static>  Object instances
          Holds existent DataTable instances, indexed by widget ID.
   
Fields inherited from class Widget
attributes
 
Constructor Summary
DataTable (<Object> attrs, <Function> func)
            DataTable is a used that transforms a regular HTML table by adding dynamic behaviors, such as sorting, row highlighting and single/multiple row selection
 
Method Summary
 <private>  Number _compare(<Object> a, <Object> b)
           Default method to compare 2 cell values.
 <private>  String _getRowValue(<Object> row, <Number> idx)
           Default method to read the text contents of a table cell
 <private>  void _onResize()
           Table resize handler
 <private>  void _setupRows()
           Configures CSS classes for all table rows
 <private>  void _setupScroll()
           Adds scrollable behavior on the data table
 void addSortType(<String> type, <Function> valueFunc, <Function> compareFunc, <Function> rowFunc)
           Register a new sort type
 Object getFirstRow()
           Get table's first row
 Object getNextRow(<Object> row)
           Get the previous sibling of a given row
 Object getPreviousRow(<Object> row)
           Get the next sibling of a given row
 Array getSelectedRows()
           Get current selected rows
 void reset()
           Refreshes sorting and scrolling behaviors.
 <private>  void selectHandler(<Event> e)
           Handles click event on table rows
 void selectRow(<Number> idx, <Boolean> b, r)
           Selects or unselects a given table row
 <private>  void selectRowUI(<Object> row, <Boolean> b)
           Applies selection UI changes on a given row
 void setup()
           Initializes the widget
 void sort(<Number> idx, <Boolean> desc)
           Sorts the table by a given column index
 <private>  void sortHandler(<Event> e)
           Handles click event on table headers
 
Methods inherited from class Widget
hasAttributes
 

Field Detail

anchor

Object anchor

desc

Boolean desc

root

Object root

selected

Array selected

sortIdx

Number sortIdx

sortTypes

Object sortTypes

table

Object table

tbody

Object tbody

thead

Object thead

instances

<static> Object instances

Constructor Detail

DataTable

DataTable(<Object> attrs, <Function> func)

Method Detail

_compare

 <private> Number _compare(<Object> a, <Object> b)

_getRowValue

 <private> String _getRowValue(<Object> row, <Number> idx)

_onResize

 <private> void _onResize()

_setupRows

 <private> void _setupRows()

_setupScroll

 <private> void _setupScroll()

addSortType

void addSortType(<String> type, <Function> valueFunc, <Function> compareFunc, <Function> rowFunc)

getFirstRow

Object getFirstRow()

getNextRow

Object getNextRow(<Object> row)

getPreviousRow

Object getPreviousRow(<Object> row)

getSelectedRows

Array getSelectedRows()

reset

void reset()

selectHandler

 <private> void selectHandler(<Event> e)

selectRow

void selectRow(<Number> idx, <Boolean> b, r)

selectRowUI

 <private> void selectRowUI(<Object> row, <Boolean> b)

setup

void setup()

sort

void sort(<Number> idx, <Boolean> desc)

sortHandler

 <private> void sortHandler(<Event> e)

PHP2Go Javascript Framework

Copyright © 2002-2006 by Marcos Pont
Documentation generated by JSDoc on Sun Oct 7 19:52:10 2007