saveState / StateRestore + searchList : filters do not reapply correctly

saveState / StateRestore + searchList : filters do not reapply correctly

EDACEDAC Posts: 3Questions: 0Answers: 0

Link to test case:

https://live.datatables.net/zoqeruze/1/edit?js,output

Debugger code (debug.datatables.net): N/A
Error messages shown: N/A

Description of problem:

When using searchList, filters (either from saveState or StateRestore) are not properly applied when loading a saved state.

Steps to reproduce:

  1. Define a text filter for "Position" (I used "en", which shows in 13 entries out of 57).
  2. Use "Create State" to save the state (this will now be State 1).
  3. Clear the filters.
  4. Select a city for "Office" (I used "Edinburgh", which has 19 entries)
  5. Use "Create State" to save the state (this will now be State 2).
  6. Clear the filters.
  7. Click "Saved States", then "State 1" to restore the "Position" filter. The filter will apply successfully (showing 13 entries again).
  8. Clear the filters.
  9. Click "Saved States", then "State 2" to restore the "Office" filter.

At this point:

  • If you click on "Saved States" again, "State 2" has a check box as if it is applied.
  • If you click on the Position filter, Edinburgh has a check box as if it is applied.
  • However, the table does not apply the filter. All rows are displayed.

I have also had users report that columns using "searchList" will occasionally reset their filters (saved using saveState)... I suspect that the two issues are related, but it's easier to reproduce using the StateRestore buttons.

Replies

Sign In or Register to comment.