Skip to content Skip to sidebar Skip to footer

Datatables - Search; But Do Not Instantly Filter The Data Table

I have been starting to use datatables.net jQuery library and its searching method. However, I currently I have the following problem: I would like to use the search functionality

Solution 1:

You haven't said how you want the search to perform, so I'll assume it's on the Return key press.

First you need to unbind the default 'keyup' event from the search input:

$("div.dataTables_filter input").unbind();

Then bind a new event which checks that the return key has been pressed, then perform the search:

$("div.dataTables_filter input").keyup(function (e) {
        if (e.keyCode == 13) {
            oTable.fnFilter(this.value);
        }
    });

Where oTable is your datatable object

You haven't said which version of Datatables you're using, this is v1.9 syntax. To change it to v1.10 you need to use oTable.search(this.value)

Post a Comment for "Datatables - Search; But Do Not Instantly Filter The Data Table"