{hero}

createState

Since: StateRestore 1.0.0

Creates a new StateRestore instance, 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 StateRestore instance and adds it to the savedStates collection. The state stored within this instance is based on the current state of the table.

This button won't do anything if stateRestore.save or stateRestore.create 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:

$.fn.dataTable.ext.buttons.createState.text = function (e, dt, node, config) {
    return "Create new state";
}