Use {stateSave: true} in the example Individual column searching (text inputs)

Use {stateSave: true} in the example Individual column searching (text inputs)

spkljlspkljl Posts: 2Questions: 1Answers: 0

I come across a question. When I applied {stateSave: true} in the example page Individual column searching (text inputs). I find the sorting and searching at the top is all OK. If I input something at the top search box, after reload the page, the input character is still there in the box and the search result is OK. But if I input character at the table foot individual search box, after reload the page, the search result is still there but there is nothing in the individual search box.
I hope after reload the page, the input character can still show in the individual search box. Is there anyway to do this?

This question has an accepted answers - jump to answer

Answers

  • allanallan Posts: 61,892Questions: 1Answers: 10,144 Site admin
    Answer ✓

    DataTables doesn't know anything about those input boxes - its API is used to trigger searches from them, but it doesn't "know" that they exist. Therefore it can't automatically fill them out when the state is loaded. Instead you'd need to use stateLoadedParams to know what parameters were loaded and set the values as required.

    I've been meaning for a while to set an example of this up as it isn't an uncommon question. I'll try to do so later this month.

    Allan

  • spkljlspkljl Posts: 2Questions: 1Answers: 0

    Thank you very much Allan, I will try to use the option as your instruction.

This discussion has been closed.