select.selectable()
Get / set the function used to determine if a row should be selectable.
Please note - this property requires the Select extension for DataTables.
Description
This method allows dynamic assignment of the select.selectable function, which is used to determine if a row should be selectable or not.
Types
select.selectable()
Get the function that is used to determine if a row is selectable.
Returns:
function or undefined:
Returns the function set using this method or select.selectable. If no function is defined, undefined is returned.
select.selectable( set )
Set the table's selectable function.
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | set | No | |
Function used to determine if a row should be selectable or not. See | |||
Returns:
DataTables.Api:
DataTables API instance for chaining.
Example
Let the user select items using the os selection style:
let table = new DataTable('#myTable', {
select: true
});
table.select.selectable((data, tr, idx) => {
return data.selectable;
});Related
The following options are directly related and may also be useful in your application development.