Index | OAT homepage | OpenLink Software

grid.js

grid.js

Advanced grid (table) control.

Objects

OAT.Grid(element, optionsObject)

Creates a grid as a child of element.optionsObject may contain:

Methods

OAT.Grid::createRow(data, [index])

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:

OAT.Grid::createHeader(data)

Creates a header row. Data is an array of either values or objects. If objects are used, they should contain:

OAT.Grid::appendHeader(data, [index])

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 OAT.Grid::createHeader().

OAT.Grid::fromTable(table)

Converts an existing table into a grid.

OAT.Grid::row::addCell(data, [index])

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 OAT.Grid::createRow(). This method should be called as grid.rows[i].addCell().

OAT.Grid::removeColumn(index)

Removes one column specified by index from the grid.

OAT.Grid::clearData()

Clears the grid (preserves header).

OAT.Grid::rows[index].select()

Selects row.

OAT.Grid::rows[index].deselect()

Deselects row.

Constants

OAT.GridData.LIMIT

Sets the minimal width of the column.

OAT.GridData.ALIGN_

Column alignment.

OAT.GridData.SORT_

Column sorting order.

OAT.GridData.TYPE_

Constants specifying the data type in a column. They affect sorting - string or numeric sorts will be used based on these constants. When set to auto, simple detection test (parsing a float of the first row) will be performed.

CSS classes

.grid

CSS class of grid table element.

.even

CSS class of even and odd rows.

.odd

CSS class of even and odd rows.

.hover

CSS class of hovered row.

.index

CSS class of the first column (index) when auto numbering option is active.

.header_value

CSS class of the header (first row) column.

.row_value

CSS class of a regular data column.

Example


myGridInstance.rows[index].select(); 
myGridInstance.rows[index].deselect(); 


Copyright (C) 2005-2009 OpenLink Software