individual column filtering
individual column filtering
jedy
Posts: 1Questions: 1Answers: 0
Hi, i used this code to individual column filtering but how to disable/hidden first column if i dont want to?
$(document).ready(function() {
$('#example thead tr').clone(true).appendTo( '#example thead' );
$('#example thead tr:eq(1) th').each( function (i) {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
table
.column(i)
.search( this.value )
.draw();
}
} );
} );
var table = $('#example').DataTable( {
orderCellsTop: true,
fixedHeader: true
} );
} );
Edited by Colin - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
This will do all the headers, so you need to restrict the
theads
you want to put theinput
elements onto, or just specifically state the ones you do.Colin