stateRestore.state().load()

Since: StateRestore 1.0.0

Load a state from StateRestore into the table.
Please note - this property requires the StateRestore extension for DataTables.

Description

Once you have states in StateRestore, you'll want to provide the end user with the ability to have the table re-take that state, so they can return to it when selected. This method provides that ability by taking the selected state, loading it into the table (state()) and then drawing the table.

Type

stateRestore.state().load()

Loads the selected state in the DataTable and draws it.

Returns:

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

Example

Load a state:

var table = new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['createState', 'savedStates']
		}
	}
});

table.stateRestore.state('{my-id}').load();

Related

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