How to Use the Grid

As described in the examples, a basic grid needs only a collection and a list of column definitions.

To display the grid, you will need to render the grid and insert the grid's root element to the DOM in order to display it.

Manipulating Columns and Rows

It is very easy to insert or remove a row in a grid, you just have to pass a model reference to Grid#insertRow or Grid#removeRow.

Inserting and remove columns is similarly easy. You just need to pass some definitions to Grid#insertColumn or Grid#removeColumn.

Sorting Programmatically

Sometimes, you might want to set the grid to a sorted state before displaying it, you can do that by calling Grid#sort() with a column name and a direction:

Sometime you may want to render a grid in a sorted state, probably based on a previously saved sorting state. You can supply a direction to a column definition and a sorted collection to a grid's constructor before you render it:

Empty Message

If you want to display a message when the grid is empty. You can pass anemptyText string to the options object to the Grid's constructor.