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 48 49 50
|
<?xml version="1.0" encoding="UTF-8" ?>
<dt-event>
<name>stateSaveParams</name>
<summary>State save event - fired when saving table state information.</summary>
<since>1.10</since>
<type type="function">
<signature>function( e, settings, data )</signature>
<parameter type="object" name="e">
jQuery event object
</parameter>
<parameter type="DataTables.Settings" name="settings">
DataTables settings object
</parameter>
<parameter type="object" name="data">
State information to be saved
</parameter>
<scope>HTML table element</scope>
</type>
<description>
The `dt-event stateSaveParams` event is the event compliment of the `dt-init stateSaveParams` initialisation option. As with the callback, the event is fired when the table has changed state a new state save is required. For the format of the data that is stored, please refer to the `dt-init stateSaveCallback` documentation.
This event allows modification of the state saving object prior to actually doing the save, including addition or other state properties (for plug-ins) or modification of a DataTables core property.
The `dt-event stateSaveParams` event is fired at the same point as `dt-init stateSaveCallback` (technically the callback fires before the event, but they occur sequentially and thus either can be used to achieve the same effect).
Please note that, as with all DataTables emitted events, this event is triggered with the `dt` namespace. As such, to listen for this event, you must also use the `dt` namespace by simply appending `.dt` to your event name, as shown in the example below.
</description>
<example title="Remove a saved filter, so filtering is never saved"><![CDATA[
$('#example')
.dataTable()
.on( 'stateSaveParams.dt', function (e, 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">stateLoadParams</related>
<related type="option">stateLoaded</related>
<related type="option">stateSaveParams</related>
<related type="event">stateLoaded</related>
<related type="event">stateLoadParams</related>
</dt-event>
|