{hero}

createState

Since: StateRestore 1.0.0

Creates a new state, based off of the current state of the table.
Please note - this property requires the StateRestore extension for DataTables.

Description

This button creates a new state and adds it to the savedStates collection. The state stored is based on the current state of the table.

This button won't do anything if the save or create options of the stateRestoreConfig configuration object are set to false, disabling saving and creation of states.

Options

This button can have the following options set in its configuration object to customise its actions and display, in addition to those options which are available for all buttons (e.g. buttons.buttons.text):

Example

createState button modify text:

DataTable.ext.buttons.createState.text = function (e, dt, node, config) {
	return 'Create new state';
};