stateLoadParams
State load event - fired when loading state from storage.
Description
The stateLoadParams
event is the event compliment of the stateLoadParams
initialisation option. As with the callback, the event is fired when the table is loading state from the stored data, but prior to that read data being applied to the data table. This allows modification of the saved state data. For the format of the data that is stored, please refer to the stateSaveCallback
documentation.
The stateLoadParams
event is fired at the same point as stateLoadCallback
(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, the event object has a DataTables API instance available on it (the first parameter). Additionally, the events are 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.
Type
function function( e, settings, json )
- Parameters:
Name Type Optional 1 e
No jQuery event object
2 settings
No DataTables settings object
3 data
No State information read from storage
Example
Remove a saved filter from the saved state data:
$('#example')
.on('stateLoadParams.dt', function (e, settings, data) {
data.search.search = '';
})
.DataTable();
Related
The following options are directly related and may also be useful in your application development.