stateLoadParams
State loaded - data manipulation callback.
Description
Callback which allows modification of the saved state prior to loading that state. This callback is called when the table is loading state from the stored data, but prior to the settings object being modified by the saved state.
Note that the stateLoadCallback
option is used to define where and how to load the state, while this function is used to manipulate the data once it has been retrieved from storage.
Further note that for plug-in authors, you should use the stateLoadParams
event to load parameters for a plug-in.
Type
function stateLoadParams( settings, data )
- Parameters:
Name Type Optional 1 settings
No DataTables settings object
2 data
No Data to save. The data comes from
stateSaveParams
Examples
Remove a saved filter, so saved filtering is never loaded:
new DataTable('#myTable', {
stateSave: true,
stateLoadParams: function (settings, data) {
data.search.search = '';
}
});
Disallow state loading by returning false:
new DataTable('#myTable', {
stateSave: true,
stateLoadParams: function (settings, data) {
return false;
}
});
Related
The following options are directly related and may also be useful in your application development.