Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
jQuery filter on return
$.extend(true, $.fn.dataTable.defaults, {
initComplete: function(settings, json) {
var api = this.api();
var dtFilter = $.fn.dataTable.settings[0].aanFeatures.f;
var dtFilterInput = $('input', dtFilter);
dtFilterInput.unbind();
/*
dtFilterInput.bind('keyup', function (event) {
if (event.keyCode == 13) {
api.search(this.value).draw();
}
});
*/
// Usually the filter is of type search => input[type=search]
dtFilterInput.bind('search', function (event) {
api.search(this.value).draw();
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment