Enhancing the Global Search
Enhancing the Global Search
bhar
Posts: 18Questions: 6Answers: 0
I am trying to get Global Search redraw the table on Enter keypress and not on Any keypress. This is the code I am using.
initComplete: function ( settings, json ) {
('#example4_filter input').unbind();
$('#example4_filter input').bind('keyup', function(e) {
if(e.keyCode == 13) {
dt4.search( this.value ).draw();
}
});
}
'''
Somehow it does not seem to work, any suggestions...?
This discussion has been closed.
Answers
You need to unbind
keypress
and the other events that DataTables listens for. You'll find those events in the source filecore.filter.js
.Allan
I use 1.10 version. I do not find the file : core.filter.js in my installation. Anyone here willing to help...
Someone on stackoverflow has posted that the above code works. Not working when I try it.....can someone rectify the above code?
The file I mentioned is in the source repo here.
Seems to be getting more complicated ...rather than easier.....
Someone can take a min or two to just guide on how to go about it...