1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-option group="callback">
<name>stateSaveParams</name>
<summary>State save - data manipulation callback</summary>
<since>1.10</since>
<type type="function">
<signature>stateSaveParams( settings, data )</signature>
<parameter type="DataTables.Settings" name="settings">
DataTables settings object
</parameter>
<parameter type="object" name="data">
Data to save. The data comes from `dt-init stateSaveParams`
</parameter>
<scope>HTML table element</scope>
</type>
<description>
Callback which allows modification of the parameters to be saved for the DataTables state saving (`dt-init stateSave`), prior to the data actually being saved. This callback is called every time DataTables requests that the state be saved. For the format of the data that is stored, please refer to the `dt-init stateSaveCallback` documentation.
Note that the `dt-init stateSaveCallback` option is used to define where and how to store the state, while this function is used to manipulate the data before it is entered into storage.
Further note that for plug-in authors, you should use the `dt-event stateSaveParams` event to add extra parameters to the state storage object if required.
</description>
<example title="Remove a saved filter, so filtering is never saved"><![CDATA[
$('#example').dataTable( {
"stateSave": true,
"stateSaveParams": function (settings, data) {
data.search.search = "";
}
} );
]]></example>
<related type="api">state()</related>
<related type="api">state.clear()</related>
<related type="api">state.loaded()</related>
<related type="api">state.save()</related>
<related type="option">stateSave</related>
<related type="option">stateSaveCallback</related>
<related type="option">stateLoadCallback</related>
<related type="option">stateLoadParams</related>
<related type="option">stateLoaded</related>
<related type="event">stateLoaded</related>
<related type="event">stateLoadParams</related>
<related type="event">stateSaveParams</related>
</dt-option>
|