DataTable Module
This module provides the following classes:
This module is a rollup of the following modules:
-
Selection
A DataTable class extension that adds capability to provide a "checkbox" (INPUT[type=checkbox]) selection capability via a new column, which includes "select all" checkbox in the TH. The class uses only a few defined attributes to add the capability. This extension works with sorted data and with paginated DataTable (via Y.DataTable.Paginator), by retaining a set of "primary keys" for the selected records. Users define the "primary keys" by either setting a property flag of "primaryKey:true" in the DataTable column configuration OR by setting the [primaryKeys](#attr_primaryKeys) attribute. To enable the "checkbox" selection, set the attribute [checkboxSelectMode](#attr_checkboxSelectMode) to true, which will add a new column as the first column and sets listeners for checkbox selections. To retrieve the "checkbox" selected records, the attribute [checkboxSelected](#attr_checkboxSelected) can be queried to return an array of objects of selected records (See method [_getCheckboxSelected](#method__getCheckboxSelected)) for details. ####Usage var dtable = new Y.DataTable({ columns: ['port','pname', 'ptitle'], data: ports, scrollable: 'y', height: '250px', // define two primary keys and enable checkbox selection mode ... primaryKeys: [ 'port', 'pname' ], checkboxSelectMode: true }).render("#dtable");