Selecting the rows
You can mark rows as selectable
with the method of that name. The callback
fires whenever one or more rows changes state. The arguments selected
and
unselected
arguments are both arrays-of-rowindexes.
You can mark individual rows as un-selectable with the
selectable
property.
You can control selection using the methods select
, unselect
and
toggle
. The methods take one or more indexes (or an array of indexes) as
arguments.
You can also omit the argument to select
, unselect
or
toggle
everything.
You can retrieve the selected indexes (as an array) with the
selected
method.
You can also confirm selection by passing one or more indexes (or an array).
If you add columns to the table, you'll get a selection menu in the header.
The menu selects or deselects all visible rows. If there are multiple pages in the table, you'll be presented with the opportunity to select all pages.
If you are loading the table data incrementally (so you manage
paging
yourself), you might like to know when all or none is selected via the
menu. The Table supports two additional callbacks that can be assigned via
selectable()
.
You can also assign these methods directly.
Here's a summary of the methods that deal with row selection.