stateRestore.defaults
Since: StateRestore 2.0.0
Allow the end user to set a default state.
Please note - this property requires the StateRestore extension for DataTables.
Description
In StateRestore, an end user has the option of selecting a state and defining it to be be the default state - that is, the state that the table will take when it is created on page load. This ability can be disabled using this option.
Please note that for defaults to be available the stateRestore property must be defined in the DataTable initialisation object. This is to allow StateRestore to define the state loader for the table.
Type
boolean
This option can be provided as a boolean value:
true- The end user can set a state to be the default statefalse- The end user cannot set a default state.
Default
- Value:
true
The user is allowed to set a default state.
Example
Disallow the end user from setting a default state.:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['stateCreate', 'statesList', 'pageLength']
}
},
stateRestore: {
defaults: false
}
});