stateRestore.states()
Get states from StateRestore.
Please note - this property requires the StateRestore extension for DataTables.
Description
This method provides the ability to retrieve states that are managed by the StateRestore extension.
stateRestore.states()
takes one argument, identifier
. This is an array of strings that are used to identify the states throughout StateRestore.
A DataTables API instance is returned containing the states that are desired. This method will mainly be used for chaining.
Type
function stateRestore.state()
- Description:
Retrieves stored states from the StateRestore extension.
- Parameters:
Name Type Optional 1 identifier
No An array of strings that are used to identify the desired states.
- Returns:
Returns a DataTables API containing the desired states so that chaining can occur.
Example
Get states called 'New State' and 'Old State':
var table = new DataTable('#myTable', {
layout: {
topStart: {
buttons: ['createState', 'savedStates']
}
}
});
table.stateRestore.states(['New State', 'Old State']);
Related
The following options are directly related and may also be useful in your application development.