xscroll not working with filters!!
xscroll not working with filters!!
erferfSsd
Posts: 2Questions: 2Answers: 0
i use 1.10 version : "scrollX": true in my datatable
but when i try to use EXAMPLES Individual column filtering (text inputs)
those search input boxs did not work ! they can not send requests to server.
do i have to change sth to make it work with "scrollX":?thanks
// Setup - add a text input to each footer cell
$('#example tfoot th').each( function () {
var title = $('#example thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
} );
// DataTable
var table = $('#example').DataTable();
// Apply the filter
$("#example tfoot input").on( 'keyup change', function () {
table
.column( $(this).parent().index()+':visible' )
.search( this.value )
.draw();
} );
This discussion has been closed.
Answers
Try:
i.e. use the
table().footer()
method to get the footer element. The problem is that the table is split into three when scrolling is enabled, so your selector isn't matching the footer.Allan