Document directory
- Row-Level Properties
- Column-Level Properties
- Order of checks
Providing data to the grid
Overview
The data is passed to the grid via the constructor and can also be accessed usingsetData(data)
AndgetData()
Methods. Data itself can be either an array-like object withlength
Property and an indexer (data[index]
) Or a custom data provider implementing the following interface:
getLength()
-Returns the number of data items in the Set
getItem(index)
-Returns the item at a given Index
getItemMetadata(index)
-Returns the metadata for the item at a given index (optional)
Item metadata
getItemMetadata
Provides a powerful way of specifying additional information about a data item that let the grid customize the appearance and handling of a participant data item. The method shocould returnnull
If the item requires no special handling, or an object in the following general format:
{ // properties describing metadata related to the item (i.e. grid row) itself "<property>": value, "<property>": value, // properties describing metadata related to individual columns "columns": { "<column index>": { // metadata indexed by column index "<property>": value, "<property>": value }, "<column id>": { // metadata indexed by column id "<property>": value, "<property>": value } }}
Row-Level Properties
cssClasses
(String)-one or more (space-separated) CSS classes to be added to the entire row.
focusable
(Boolean)-whether or not any cells in the row can be set as "active ".
selectable
(Boolean)-whether or not a row or any cells in it can be selected.
Column-Level Properties
focusable
(Boolean)-whether or not a cell can be set as "active ".
selectable
(Boolean)-whether or not a cell can be selected.
formatter
(Function)-a custom cell formatter.
editor
(Function)-a custom cell editor.
colspan
(Number | string)-Number of columns this cell will span. can also contain "*" to indicate that the cell shoshould span the rest of the row.
Order of checks
When looking up a property, the grid checks in the following order:
- Row-level item metadata.
- Column-level item metadata by column ID.
- Column-level item metadata by column index.
- Column definition.
- Grid options.
- Grid ults.
Examples
See colspan example.