{hero}

state.save()

Since: DataTables 1.10.1

Trigger a state save.

Description

This method is primarily made available for plug-in authors who wish to be able to add information to the DataTables state saving object (through stateSaveParams) and want to be able to trigger a state save to save information specific to their plug-in.

As an example, a column filter plug-in might trigger a state save when the input values for the filter are altered by the end user. This enables the author to reliably restore the state of their plug-in when the table is next initialised (state.loaded()).

Type

function state.save()

Description:

Trigger a state save

Returns:

The API instance that was used, available for chaining.

Example

Jump to the next page and save state (the page() method does not trigger a state save itself):

table.page('next');
table.state.save();

Related

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