grid.js
Advanced grid control.
Objects
Methods
Constants
- OAT.Grid.ALIGN_CENTER
- OAT.Grid.ALIGN_LEFT
- OAT.Grid.ALIGN_RIGHT
- OAT.Grid.SORT_NONE
- OAT.Grid.SORT_ASC
- OAT.Grid.SORT_DESC
- OAT.Grid.TYPE_AUTO
- OAT.Grid.TYPE_STRING
- OAT.Grid.TYPE_NUMERIC
CSS classes
- .grid
- .even
- .odd
- .hover
- .index
- .header_value
- .row_value
Creates a grid as a child of element. optionsObject may contain:
- autoNumber - Grid will automatically add the first auto-numbered column
- rowOffset - starting offset for auto-numbered column
- allowColumnHiding - user can toggle column visibility at runtime
- sortFunc - custom user-specified sorting routine
- imagePath - path to images (with trailing slash)
- reorderNotifier - routine to be called when column reordering occurs
Adds a row. If index is present, it specifies at which index the new row should be inserted. Data
is an array of either values or objects. If objects are used, they should contain:
- value - cell value
- align - one of ALIGN_ constants
Creates a header row. Data is an array of either values or objects.
If objects are used, they should contain:
- value - cell value
- sortable - whether this column is sortable
- draggable - whether this column is draggable
- resizable - whether this column is resizable
- align - one of ALIGN_ constants
- sort - one of SORT_ constants
- type - one of TYPE_ constants
Adds a new header cell. If index is present, it specifies at which index the new cell should be inserted.
Data are in the same format as in createHeader
.
Converts an existing table into a grid.
Adds one cell to one row. If index is present, it specifies at which index new cell should be inserted.
Data are in the same format as in createRow
. This method should be called as grid.rows[i].addCell()
.
Removes one column from the grid.
Clears the grid (preserves header).