stateRestore.canCreate
Set if the end user is allowed to create new states.
Please note - this property requires the StateRestore extension for DataTables.
Description
StateRestore offers the end user to create new states not only through the stateCreate button, but also through the sub-buttons for states which are shared in, or predefined by duplicating them.
While it is trivial to leave out the stateCreate button, if you don't want the end user to be able to create new states from others that are available to them (i.e. you just want to provide a list of states that you control), this option is available to disable that ability.
Type
boolean
When false the end user will not be able to create new states. When true, they will.
Default
- Value:
true
The end user will be able to create new states.
Example
Provide a single state and the end user cannot add their own or duplicate:
new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['statesList', 'pageLength']
}
},
stateRestore: {
canCreate: false,
preDefined: [
{search: {search: "Edinburgh"}}
]
}
});