Refresh DataTable data after clearing Search input field
Refresh DataTable data after clearing Search input field
 fmsthird            
            
                Posts: 8Questions: 2Answers: 0
fmsthird            
            
                Posts: 8Questions: 2Answers: 0            
            I'm trying to clear the Search input field when a button is clicked via jQuery.
    $('#clear-filter').click(function() {
      $('#filter-input').val('');
    });
The input was cleared but the Table is not refreshed or reset.
I actually had to hit backspace again before the data will show.
Is there any way I can reset the table after clearing Search input field without hitting backspace again?
Or are there any other way I can refresh the table.
Thanks
Note: Data is loaded from Server-side
This discussion has been closed.
            
Replies
You can use a blank search string with
search(), for exampletable.search( "" ).draw();. The input will also be cleared with this statement.Kevin
Hi Kevin,
Thanks. I tried to apply it now. but it doesn't work.
Tried like this
Like I said you need to use a blank search string:
search( "" ).Kevin
Damn! Awesome it works like a charm.
I thought I was posting a question and I was trying to find where to accept your answer @kthorngren