stateRestore.states()
Get states from StateRestore.
Please note - this property requires the StateRestore extension for DataTables.
Description
This method provides the ability to selected states that are managed by the StateRestore extension for further manipulation by chained methods.
The state selector is an array of values that will match against the id property of the StateRestore.State object. If no selector is provided, then all states will automatically be selected.
Type
stateRestore.state(ids)
Retrieves stored states from the StateRestore extension.
Parameters:
| Name | Type | Optional | |
|---|---|---|---|
| 1 | ids | Yes - default: | |
An array of values that are used to identify the desired states. If no value is given, all states are selected. | |||
Returns:
DataTable.Api:
Returns a DataTables API instance for the states selected.
Example
Select two states by a given id:
console.log(
table.stateRestore.states(['{id1}', '{id2}']).details().toArray();
);Related
The following options are directly related and may also be useful in your application development.