selectItems
Select items type change event.
Please note - this property requires the Select extension for DataTables.
Description
This event is triggered whenever the items that are to be selected (rows, columns, cells) is changed. This can be done using the select.items
initialisation option or the select.items()
API method.
Please note that, as with all DataTables emitted events, this event is triggered with the dt
namespace. As such, to listen for this event, you must also use the dt
namespace by simply appending .dt
to your event name (this is done automatically when using on()
and one()
).
Type
function function( e, dt, items )
- Parameters:
Name Type Optional 1 e
No jQuery event object
2 dt
No DataTables API instance
3 items
No The items that are now available for selection by the end user. See
select.items
.
Example
Log whenever the item selection type changes:
var table = new DataTable('#myTable');
table.on('selectItems', function (e, dt, items) {
console.log('Items to be selected are now: ', items);
});