buttons().active()
Set the active state for the selected buttons.
Please note - this property requires the Buttons extension for DataTables.
Description
Buttons can be placed into an "active" state which is purely a styling function to visually show to the end user that the button is active (i.e. whatever operation it performs is currently active). This can be useful if you have a number of different modes of operation that the user can select from, but only one can be active at a time.
This method can be used to dynamically change the active state for the selected buttons.
Types
buttons().active()
Get the active state for the selected buttons.
Parameters:
Name | Type | Optional | |
---|---|---|---|
1 | state | No | |
Get the current active state of the buttons. |
Returns:
DataTables.Api
API instance which contains true
if currently active, otherwise false
for each selected button in the result set.
buttons().active( state )
Set the active state for the selected button.
Parameters:
Name | Type | Optional | |
---|---|---|---|
1 | state | No | |
Set the active state ( |
Returns:
DataTables.Api
DataTables API instance with the selected buttons in the result set, available for chaining further operations on the buttons.
Example
Remove the active state from all buttons:
var table = new DataTable('#myTable');
table.buttons().active(false);