jQuery Datatable Reset Search and Filters
- Article
- Comment (4)
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 .
var kv_datatable_example = $('#kvcodes_table_id').DataTable( //Here my custom code... );
Now , you can add the following code to a button, there before create a rest button and get its click action.
$('#reset_btn_id').on('click', function(){ kv_datatable_example.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.
Thank you for such an elegant, simple solution!
Thank you, it was very helpful!
Welcome, I am glad to hear it.
Thank you so much for this. It really saved my day.