{hero}

stateRestore.splitSecondaries

Since: StateRestore 1.0.2

Set the split buttons that will be displayed within StateRestore split dropdowns.
Please note - this property requires the StateRestore extension for DataTables.

Description

This option allows for the buttons provided by each StateRestore state to be customised, or added to.

As default the value is the array of default buttons shown below. These buttons provide all of the standard functionality for StateRestore. While all of the default buttons are present, if stateRestore.save, stateRestore.rename or stateRestore.remove are set to false, the corresponding buttons will still be removed.

This option is configured in the same format as buttons.buttons, please refer to the documentation there for full details.

Type

array

Description:

This array contains the buttons which are to be added within the split dropdown for the StateRestore Buttons. The buttons within this array can be declared in the same form as the buttons.buttons option, please read that documentation for full details.

Default

  • Value: array

The default value for the stateRestore.rename option is as follows.

    splitSecondaries: [
        'updateState',
        'renameState',
        'removeState'
    ]

These are the default buttons that provide functionality to StateRestore states.

Example

Customise the buttons held within the StateRestore state split dropdowns.:

$('#example').DataTable({
	dom: 'Blfrtip',
	buttons:[
		{
			extend: 'savedStates',
			config: {
				splitSecondaries: [
					'updateState',
					'removeState',
					'<h3>Custom HTML!</h3>',
					'pdf',
					{
						extend: 'renameState',
						className: 'red-border'
					}
				]
			}
		},
		'createState'
	]
});