Thursday, February 18, 2016

jQuery Datatable Reset Search and Filters

jQuery Datatable Reset Search and Filters. This post talks you about the Datatable filters. Here we are going to reset the search operation in the middle of search results. get the whole results.  This will work on server side as well. The following code helps you to do that operation. It will work on individual column search’s as well.
Here the following code helps us to create a datatable from html table .
you can add the following code to a button, there before create a rest button and get its click action.
$(document).on('click', '.SaveButton', function (e) {
 var table = $closestform.find('table').DataTable();
    table.search('').columns().search('').draw();
}
That’s it. It will take care the reset operation.  When you want to reset a search operation, just use the above function to get it.

No comments:

Post a Comment