Reputation: 3875
I want to save all the fields in bstatesave
except for search
This is my code
$('#dataTable').DataTable({
columnDefs: [
{orderable: false, targets: -1}
],
"bStateSave": true
});
I tried several ways but either search re-appears of jquery datatable doesn't work. I want it to work exactly like this, just don't the search in it. How can I achieve this?
Upvotes: 1
Views: 288
Reputation: 42054
From the documentation you can use the following callback:
stateSaveParams( settings, data ): allows modification of the parameters to be saved for the DataTables state saving
$('#dataTable').DataTable({
columnDefs: [{
orderable: false, targets: -1
}],
"bStateSave": true,
"stateSaveParams": function (settings, data) {
data.search.search = "";
}
});
Upvotes: 1