unable to get filtering to work
unable to get filtering to work
If I try to change "dataTable" to DataTable, like many suggestions my console.log(table) is an empty array. But if I do the following I get this: https://www.dropbox.com/s/9n35jqriuhlkcnf/Screenshot%202015-10-15%2016.04.27.png?dl=0
But then I get this error:
TypeError: table.columns is not a function. (In 'table.columns()', 'table.columns' is undefined)
I'm using version 1.10.9. What am I doing wrong. Scrolling is working correctly and the search boxes created by this are working, just not the searching itself.
$('#cust_list tfoot th').each( function () {
var title = $('#cust_list thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// DataTable
var table = $('#cust_list').dataTable({
scrollY: "700px",
scrollX: true,
scrollCollapse: false,
paging: false,
bFilter: false
});
console.log(table);
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
Answers
Upper/Lower case is not an artistic decision, you need to use the right one. :)
The difference is described here, http://datatables.net/manual/api
Compare your code to the example.
http://datatables.net/examples/api/multi_filter.html