statesRemoveAll

Since: StateRestore 2.0.0

Removes all stored states.
Please note - this property requires the StateRestore extension for DataTables.

Description

This button provides the end user with the ability to delete all states that they have the ability to delete (i.e. not states which are predefined or shared with them).

When selected a confirmation modal will be shown asking the user if they are sure they wish to proceed with the deletion.

There are no additional configuration options for this button beyond the standard set offered by all buttons (e.g. buttons.buttons.text).

Please note that the label for this button defaults to "Remove all states", which can be customised with the stateRestore.button.statesRemoveAll language option (see language.stateRestore), or with the button's text option.

Furthermore, this button provides an alias name (removeAllStates) to assist with porting from StateRestore v1. The new name is preferred and should be used for all new projects.

Example

Delete all button in a state list:

new DataTable('#example', {
	layout: {
		topStart: {
			buttons: [
				{
					extend: 'statesList',
					buttons: [
						'stateCreate',
						'statesRemoveAll',
						{extend: 'spacer', style: 'bar'}
					]
				}
			]
		}
	},
	stateRestore: true
});