Save query string in client side search
Save query string in client side search
fantasticmv
Posts: 2Questions: 1Answers: 0
I have implemented datatables client side. Everything works fine and speed is good too. The question I have is if there is a way to save query strings? I want to aggregate and analyze to see what users are searching for
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
You could listen for the
search
event and log the search term they are searching for (e.g. trigger an Ajax request to save that information into a database).Allan
worked! thanks @allan
code -
$('#company_table').on('search.dt', function() {
var value = $('.dataTables_filter input').val()
saveToFile(value); // <-- the value send to AJAX request to push to server
});