Save query string in client side search

Save query string in client side search

fantasticmvfantasticmv 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

Answers

  • allanallan Posts: 63,310Questions: 1Answers: 10,433 Site admin
    Answer ✓

    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

  • fantasticmvfantasticmv Posts: 2Questions: 1Answers: 0

    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
    });

This discussion has been closed.