Datatables use stateSave but override displayStart
Datatables use stateSave but override displayStart

I'm using datatables and the saveState
feature. This is working fine, but in my table, the content inside the table is not always the same. I mean, that in the same table, I can load content of customer A and also switch to content of customer B. Customer B can have 200 rows, while customer A only has 40 rows.
If I set the result to customer B, I get 200 rows, devided over 20 pages (10 results per page). When I am on page 20, and switch to customer A, I don't see anything because it loads data starting at 180 (serverSide
). And A only has 40 rows. But when the page is loaded again, it must always load page 1.
Actually, from the stateSave
function, I only need it to remember the pageLength
. How can I fix this?
This question has an accepted answers - jump to answer
Answers
Use
stateSaveParams
to delete what you don't want.Allan
Awesome!
I now initialized it like: