grid.js

Advanced grid control.


Objects

Methods

Constants

CSS classes


OAT.Grid(element, autoNumber)

Creates a grid as a child of element. If autoNumber is true, than the Grid will automatically add the first, auto-numbered column.

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

OAT.Grid::removeColumn(index)

Removes one column from the grid.

OAT.Grid::clearData()

Clears the grid (preserves header).