select.items()
Get / set the items that Select will select based on user interaction (rows, columns or cells).
Please note - this property requires the Select extension for DataTables.
Description
Select provides the option for end users to be able to select rows, columns or cells in a table (i.e. the table's items). This method can be used to dynamically set which item will be selected if the end user is permitted to select items in the table (see the select.style
and select.style()
option and method).
Please note that setting this option effects only the end user interaction with the table. It is still possible to select other items via the API (e.g. if the items are set to select cells, you can still use rows().select()
to select a row).
Types
function select.items()
- Description:
Get the items that will be selected by user interaction (i.e. a click on the table).
- Returns:
The current item that will be selected when the user interacts with Select's event listeners - this will be the value
row
,column
orcell
.
function select.items( set )
- Description:
Set the item type that will be selected by user interaction.
- Parameters:
Name Type Optional 1 set
No Items to select - this must be one of
row
,column
orcells
.- Returns:
DataTables API instance for chaining.
Example
Let the user select cells by clicking on them:
var table = new DataTable('#myTable');
table.select.style('os');
table.select.items('cell');
Related
The following options are directly related and may also be useful in your application development.