Get / set the item selector for mouse event capture.
Please note - this property requires the Select extension for DataTables.
Select has the ability to restrict which cells in the table will trigger item selection (be it row, column or cell selection). By default (
select.selector) all cells can be used to select items, but this method provides the ability to modify that through the use of jQuery selectors.
This can be useful if you wish to ensure that only certain items in the table can be used to trigger selection - for example checkboxes in the first column, or to ignore action links in the last column.
Get the current item selector string applied to the table.
Get the item selector string being used for the table.
Note that if multiple tables are defined in the API's context, only the selector of the first table will be returned.
function select.selector( set )
Set the table's item selector string. Note that any old selectors will be automatically removed if this is used as a selector to ensure that there are no memory leaks in unattached event listeners.
Name Type Optional 1
jQuery selector that will select the cells that can trigger item selection.
DataTables API instance for chaining.
Allow selection on the first column only:
var table = $('#myTable').DataTable(); table.select.selector( 'td:first-child' );
The following options are directly related and may also be useful in your application development.