how to load value in datatables search, doing ajax query?
how to load value in datatables search, doing ajax query?
cris19n
Posts: 55Questions: 18Answers: 0
How can I load the value in "oSearch" before the data is loaded, but this value is retrieved from an ajax query?
I need to do an ajax query to put the value in the search field.
I can do a function within the search.
something like that:
"oSearch": {"sSearch": /*here ajax query, to get the value, I need to search datatables on its first load*/}
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Use a jQuery ajax request to fetch the search term. In the
success
function initialize Datatables with the search term, something like this:Kevin