".every()" coming back as "undefined", but seems to be correct use of ".DataTables()"
".every()" coming back as "undefined", but seems to be correct use of ".DataTables()"
I am using DataTables 1.10.5.
I looked at the FAQ before posting, and found that usually any APIs that come back as undefined indicate a misuse of ".dataTables()" vs. ".DataTables()". I assume that since my code, which attempts to create individual column filtering, is copied directly from the Multi-Search Documentation (with the exception of my own custom selectors, of course), it should be using the correct case, but there are APIs within this copied function which seem to be coming back undefined (I.E. "..columns(...).every"
)
function multiSearchMaker() {
// Setup - add a text input to each footer cell
$('.SMSTable tfoot th').each(function () {
var title = $('#example thead th').eq($(this).index()).text();
$(this).html('<input type="text" placeholder="Search ' + title + '" />');
});
// DataTable
var table = $('.SMSTable').DataTable();
// Apply the search
table.columns().every(function () {
var that = this;
$('input', this.footer()).on('keyup change', function () {
that
.search(this.value)
.draw();
});
});
}
This question has an accepted answers - jump to answer
Answers
From the
columns().every()
documentation::-)
Allan
Thanks!