fnFilter() - Trying To Clear Contents of Filter Field and Reset Filter -Uses Bootstrap 3 input-group

fnFilter() - Trying To Clear Contents of Filter Field and Reset Filter -Uses Bootstrap 3 input-group

JoyrexJoyrex Posts: 92Questions: 14Answers: 3
edited April 2014 in DataTables 1.10
Here's a DataTables Live link to what I'm trying to do: http://live.datatables.net/edit/72/edit?html,css,js,output

I had this working in DataTables 1.9.4 and Bootstrap 3, but for some reason now it no longer works - I'm not entirely sure it's how I'm targeting the filter input, or if fnFilter() has changed in DataTables 1.10 (the documentation I've read so far doesn't lead me to believe so).

Any advice/assistance is greatly appreciated!

Replies

  • JoyrexJoyrex Posts: 92Questions: 14Answers: 3
    I managed to figure it out - I wasn't targeting the input correctly (although I can't see how this worked in 1.9.4), so this was the solution for the button to clear the search AND reset the dataTable filter:
    [code]
    $('button.btn.btn-danger').click(function() {
    $('input[type=search]').val('');
    oTable.fnFilter('');
    } );
    [/code]
This discussion has been closed.