stateRestore.state().remove()
Remove a state from StateRestore.
Please note - this property requires the StateRestore extension for DataTables.
Description
This method provides the ability to remove a state that is managed by the stateRestore
extension.
stateRestore.state().remove()
takes one argument, skipModal
that allows the confirmation modal to be bypassed. The default for skipModal
is false
, meaning that the modal will be shown. It removes the state retrieved by the previous call to stateRestore.state()
.
A Datatables API is returned so that further chaining can occur.
If the stateRestore.remove
initialisation option is set to false
then this API method will not do anything.
Type
function stateRestore.state().remove()
- Description:
Removes a stored state from the StateRestore extension.
- Parameters:
Name Type Optional 1 skipModal
Yes - default:false Boolean value indicating if the confirmation modal should be skipped or not. The default is
false
meaning that the modal will be shown.- Returns:
Returns a DataTables API for chaining.
Examples
Remove a state called 'New State':
$(document).ready(function() {
var table = $('#example').DataTable({
dom: 'Blfrtip',
buttons:['createState', 'savedStates']
});
table.stateRestore.state("New State").remove()
});
Remove a state called 'New State', skipping the confirmation modal:
$(document).ready(function() {
var table = $('#example').DataTable({
dom: 'Blfrtip',
buttons:['createState', 'savedStates']
});
table.stateRestore.state("New State").remove(true)
});
Related
The following options are directly related and may also be useful in your application development.