A grid binding plugin for Knockout.js that provides basic integration with the JqGrid plugin for jQuery.
Features include: Binding to an observable array of items, progressive enhancement of an existing table (using an extension of the jqgrid tabletogrid feature), selected item and mulit-select items binding, and templated column support.
The grid binding plug uses the markup of the table to internally derive an appropriate column model for jqgrid to work upon. The data-field attribute denotes the property of each array item to bind a column to, and its header text will carry into the rendered table. A th element is required for each column desired in the rendered table. Optionally, a template can be specified for any column by providing a binding template for the column inside of the tbody element. NB: any inline column widths/styles will be carried into jqgrids column model, and applied to the resultant grid.
The plugin provides additional support for carrying across metadata into the internal colModel that is used by jqgrid. This allows many of the colModel options to be used, although only those options that take a string parameter are currently supported.
To provide additional column model options, a data-* attribute can be applied to the th element for the appropriate column.
For example, in an instance where a column is used to represent, the following markup can be specified:
This will apply the sortType and datefmt options against the colModel for the 'created' column.