Basic initialization
Select is an extension for DataTables that provides table item selection capabilities. In its most simple form it can be enabled on a DataTable by setting the selectoption to be true. This will enable Select with all of its default options - row selection which is performed using the osmethod (click to select a single item, cmd/ctrlto add and remove items or shiftto select a range of items).
Single item selection
This example shows the singleitem selection option. Here only a single item can be selected, any other selected items will be automatically deselected when a new item is selected. The select.styleoption provides the ability to control how items are selected in the table. It is a stringthat can be used with one of the following options: single- single item selection, multi- multiple items selection, os- OS style selection.
Multiple items selection
This example shows the multioption. The select.styleoption provides the ability to control how items are selected in the table. It is a stringthat can be used with one of the following options: single- single item selection, multi- multiple items selection, os- OS style selection. Note how a click on a row will toggle its selected state without effecting other rows, unlike the os and single options shown in other examples.
Checkbox selection
A selected row is typically shown in a DataTable by using a highlight background colour - however, it can also be useful to use other styling options to convey the selected state of items in a table to the end user. The checkbox is not an <input type="checkbox">element, but rather a CSS that uses the :beforeand :afterpseudo elements of the cell to draw a box and the tick. This can therefore be easily modified to suit the style of your site/app.
Control buttons
Buttons that can be used with the Buttonsextension. Buttons is a framework providing common options, styling and API methods for buttons that can control a DataTable. Available buttons: selected- enabled only when one or more items are selected, selectedSingle- enabled only when a single item is selected, selectAll- select all, selectNone- deselect all, selectRows- select rows, selectColumns- select columns and selectCells- select cells.