{hero}

stateRestore.activeStates()

Since: StateRestore 1.0.1

Get the details of all of the currently active states.
Please note - this property requires the StateRestore extension for DataTables.

Description

This method provides the ability to retrieve details about all of the currently active states that are managed by the StateRestore extension.

The method is plural as it is possible to have multiple states that are active at the same time.

A DataTables API instance is returned containing all of the active states as objects. Each object contains the following properties.

  • name - The name of the state.
  • data - The data that is used to implement the state.

Type

function stateRestore.activeStates()

Description:

Retrieves a stored state from the StateRestore extension.

Returns:

Returns a DataTables API containing an array of details about the states that are currently active.

Example

Get the currently active states:

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

table.stateRestore.activeStates();