Disable on-the-fly search
Disable on-the-fly search
SebastianG86
Posts: 5Questions: 0Answers: 0
Hallo,
First I want to thank all of you for developing DataTables. It's a pleasure to use it and saves a lot of time.
I have a small question, unfortunately I wasn't able to find a solution in the documentation. I hope it's not a big one: I want to disable on-the-fly search. I have implemented server-side processing and it works fine, but sending a request after each key press produces a serious server load.
Is it possible to make DataTable wait for pressing Enter or something like that?
First I want to thank all of you for developing DataTables. It's a pleasure to use it and saves a lot of time.
I have a small question, unfortunately I wasn't able to find a solution in the documentation. I hope it's not a big one: I want to disable on-the-fly search. I have implemented server-side processing and it works fine, but sending a request after each key press produces a serious server load.
Is it possible to make DataTable wait for pressing Enter or something like that?
This discussion has been closed.
Replies
Or you can use fnFilter to call the filtering whenever you want (enter / button etc).
Allan
This is why I added the following lines into the plugin's keyup-binding:
[code]
anControl.unbind( 'keyup' ).bind( 'keyup', function(e) {
var $$this = $this;
// Search immediately if enter was hit
if ((e.keyCode || e.which) == 13) {
window.clearTimeout(oTimerId);
sPreviousSearch = anControl.val();
$.fn.dataTableExt.iApiIndex = i;
_that.fnFilter( anControl.val() );
return this;
}
...
[/code]
As mentioned before I am not that familiar with DataTables and it's plugins so I don't want to say it's a good solution. At least it works.