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 but I do not want to have the automatically filtering available. In other words, when I search for a term, I would like to keep all the data in the table. By default, the search functions as a filter (instant-search). This means on key-up the data table shrinks when the term has not been matched and only the rows are displayed that contain the term. This is not what I need. Has anybody experienced this problem before and has a solution for it?
Unfortunately, I haven't found anything on the datatables.net website.
Thanks!
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:
Then bind a new event which checks that the return key has been pressed, then perform the search:
Where
oTable
is yourdatatable
objectYou haven't said which version of
Datatables
you're using, this is v1.9 syntax. To change it to v1.10 you need to useoTable.search(this.value)