{hero}

stateRestore.state().rename()

Since: StateRestore 1.0.0

Rename a state from StateRestore.
Please note - this property requires the StateRestore extension for DataTables.

Description

This method provides the ability to rename a state that is managed by the StateRestore extension.

stateRestore.state().rename() takes one argument, newIdentifier that is the new identifier for the selected state. It renames the state retrieved by the previous call to stateRestore.state().

A DataTables API instance is returned so that further chaining can occur.

If the rename option of the stateRestoreConfig configuration object is set to false then this API method will not do anything.

Type

function stateRestore.state().rename()

Description:

Renames a stored state from the StateRestore extension.

Parameters:
Returns:

Returns a DataTables API for chaining.

Example

Rename a state called 'New State':

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

table.stateRestore.state('New State').rename('New Name');

Related

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