createState
Creates a new state, based off of the current state of the table.
Please note - this property requires the StateRestore extension for DataTables.
Description
This button creates a new state and adds it to the savedStates
collection. The state stored is based on the current state of the table.
This button won't do anything if the save
or create
options of the stateRestoreConfig
configuration object are set to false
, disabling saving and creation of states.
Options
This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text
):
Name | Type | Default |
---|---|---|
config | {} | |
This option allows for StateRestore to be configured, particularly for column specific options. |
Example
createState button modify text:
DataTable.ext.buttons.createState.text = function (e, dt, node, config) {
return 'Create new state';
};