stateRestore.newName

Since: StateRestore 2.0.0

Set the default for a new state name.
Please note - this property requires the StateRestore extension for DataTables.

Description

When a new state is created with stateCreate, a modal is shown with a state name prepopulated - the string that is used for that value is defined by this property.

If multiple states share the same base name (i.e. this name plus a number), StateRestore will look through them to determine the next number is the sequence and then use that next number to create a unique name for the end user. Where the number is added is defined by a # character in the string.

Type

string

The value that will be used for a new state name. # can be used in the string and will be replaced by the next number in the sequence when creating multiple new states.

Default

  • Value: State #

Examples

Define a custom string for the new state default:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['stateCreate', 'statesList']
		}
	},
	stateRestore: {
		newName: 'État #'
	}
});

Empty string - make the user pick their own state name:

new DataTable('#myTable', {
	layout: {
		topStart: {
			buttons: ['stateCreate', 'statesList']
		}
	},
	stateRestore: {
		newName: ''
	}
});