selectAll
Select all items in the table based on the current item select mode.
Please note - this property requires the Select extension for DataTables.
Description
The selectAll
button will simply select all items in the table, based on the current item selection mode (select.items()
) - e.g. if the item selection mode is rows
, all rows in the table will be selected when this button is activated.
Examples
DataTables initialisation: Show select all and select none buttons with language options in the DataTables language object:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['selectAll', 'selectNone']
}
},
language: {
buttons: {
selectAll: 'Select all items',
selectNone: 'Select none'
}
}
});
Using a selector modifier to select only rows matched by the current filter (first button), and those on the first page (second button).:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: [
{
text: 'Select filter applied - object',
extend: 'selectAll',
selectorModifier: {
search: 'applied'
}
},
{
text: 'Select current page - function',
extend: 'selectAll',
selectorModifier: function () {
return {
page: 'current'
};
}
},
'selectNone'
]
}
}
});