I tried Techie's code, too. Of course, I also got the error message fnFilter is not a function
.
Actually, replacing the line oTable.fnFilter(this.value);
through oTable.search( this.value ).draw();
would do the job, but in my case, the unbind/bind functions were executed before my server-side searched table was initialised. Therefore, I put the unbind/bind functions into the initComplete
callback function, and everything works fine:
$(document).ready(function() {
var oTable = $('#test').dataTable( {
"...": "...",
"initComplete": function(settings, json) {
$('#test_filter input').unbind();
$('#test_filter input').bind('keyup', function(e) {
if(e.keyCode == 13) {
oTable.search( this.value ).draw();
}
});
}
});
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…