≡

stateRestore.state().save()

Since: StateRestore 1.0.0

Replace the state with the currently active state.
Please note - this property requires the StateRestore extension for DataTables.

Description

You might wish to offer the end user the ability to change the table state that is stored in a particular StateRestore state object. This method provides that ability (it might be more correctly called stateRestore.state().replace(), but the name is used for backwards compatibility).

This is very similar to stateRestore.state().edit(), but that method will mutate an existing state allowing the properties to be modified, but not to add any new information to the table state itself. This method provides that ability, replacing (completely) the saved state with the current table state.

Type

stateRestore.state().save(skipModal)

Saves the current state into a stored state in the StateRestore extension.

Parameters:

Returns:

DataTable.Api: Returns a DataTables API instance for chaining.

Example

Update a state with the table's current state:

table.stateRestore.state('{id}').save();

Related

The following options are directly related and may also be useful in your application development.