Search Field: Persisting Value: How to clear upon refresh or new session?
Search Field: Persisting Value: How to clear upon refresh or new session?
jeff00seattle
Posts: 3Questions: 3Answers: 0
in DataTables
I wish to have DataTable's search field cleared upon either pressing refresh or starting a new session.
What is happening is that upon initial mounting of DataTable, the search field is blank, then I add a value to search field and it finds results, good. However, after I logout and sign back into site, the DataTable's search field still has the last value I entered, not good.
What is the best way to resolve this?
This discussion has been closed.
Answers
Sounds like you have state saving enabled. Do you (
stateSave
)? If you don't want state saving, I would suggest disabling it.Allan
I do not have a stateSave option (indeed, don't know what that is). How does one clear the search field and make all the rows of a table visible again?
Use
search()
with an empty string.Allan