stateRestore.state().save()
Save a state from StateRestore.
Please note - this property requires the StateRestore extension for DataTables.
Description
This method provides the ability to save a state that is managed by the stateRestore
extension.
stateRestore.state().save()
takes no arguments. It saves the state retrieved by the previous call to stateRestore.state()
.
A Datatables API is returned so that further chaining can occur.
If the stateRestore.save
initialisation option is set to false
then this API method will not do anything.
Type
function stateRestore.state().save()
- Description:
Saves the current state into a stored state in the StateRestore extension.
- Returns:
Returns a DataTables API for chaining.
Example
Save a state called 'New State':
$(document).ready(function() {
var table = $('#example').DataTable({
dom: 'Blfrtip',
buttons:['createState', 'savedStates']
});
table.stateRestore.state("New State").save()
});
Related
The following options are directly related and may also be useful in your application development.