Since: DataTables 1.10

State save - data manipulation callback.


Callback which allows modification of the parameters to be saved for the DataTables state saving (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 stateSaveCallback documentation.

Note that the 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 stateSaveParams event to add extra parameters to the state storage object if required.


function stateSaveParams( settings, data )



Remove a saved filter, so filtering is never saved:

$('#example').dataTable( {
  "stateSave": true,
  "stateSaveParams": function (settings, data) {
    data.search.search = "";
} );


The following options are directly related and may also be useful in your application development.