stateCreate
Creates a new state, based on 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 collection stored by StateRestore. The state stored is based on the current state of the table.
There are no additional configuration options for this button beyond the standard set offered by all buttons (e.g. buttons.buttons.text).
Please note that the label for this button defaults to "Create new state", which can be customised with the stateRestore.button.create language option (see language.stateRestore), or with the button's text option.
Furthermore, this button provides an alias name (createState) to assist with porting from StateRestore v1. The new name is preferred and should be used for all new projects.
Example
Use the stateCreate button:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['stateCreate', 'statesList']
}
},
stateRestore: true
});Related
The following options are directly related and may also be useful in your application development.