Bug: With stateSave true, search column, return to page & column input is blank but still filter

Bug: With stateSave true, search column, return to page & column input is blank but still filter

jrt38472jrt38472 Posts: 2Questions: 1Answers: 0
edited June 2021 in DataTables 1.10

Problem:
Bug: With stateSave true, search column, return to page & column input is blank but still filtered

Link to test case: https://codepen.io/sfauch1/pen/YGWGyN?editors=1010

I'm able to create this same problem, not just in codepen, but also in my local and production servers. But this codepen is useful to illustrate the problem without other variables in the way.

Description of problem / How to Recreate Problem:

  • Go to the codepen above
  • Change the initialization of Datatable to this, at line 9, by adding stateSave is true:

// DataTable
var table = $('#tbAdresse').DataTable({stateSave: true});

  • Now, in the Search Position column, type into the search "System" and press Enter
  • See that there are 3 rows result
  • Now, Refresh the browser page
  • The datatable initialize is back to the default, add again to line 9, that stateSave is true
  • Wait for the lower pane to self refresh after the JS change
  • See that the column Search for Position is blank, but it is still showing 3 results of System

Thoughts?

  • Can this be officially fixed?
  • This problem was already seen years ago in previous versions.
  • Or, did I miss the fix somewhere?

Thank you!

This question has an accepted answers - jump to answer

Answers

  • kthorngrenkthorngren Posts: 20,144Questions: 26Answers: 4,736
    Answer ✓

    The search inputs are not created nor controlled by Datatables. Custom code is used to create them. As such their state is not saved or restored by Datatables. There are some links to threads that might help you use stataLoadParams to update the inputs in this thread.

    Kevin

  • jrt38472jrt38472 Posts: 2Questions: 1Answers: 0

    Thanks!

    If I could change the title of this post, I would, since it isn't a bug.

Sign In or Register to comment.