Remove a text input in first header cell Datatable
Remove a text input in first header cell Datatable
How to remove a text input in first header cell?
Found some solutions here, but they just don't work.
Thank you for your help.
$('#myTable thead tr').clone(true).appendTo( '#myTable thead' );
$('#myTable thead tr:eq(1) th').each( function (i) {
var title = $(this).text();
$(this).html( '<input type="text" placeholder="'+title+'" />' );
$( 'input', this ).on( 'keyup change', function () {
if ( table.column(i).search() !== this.value ) {
table
.column(i)
.search( this.value )
.draw();
}
} );
} );
This question has an accepted answers - jump to answer
Answers
You're going through all the <th>s in your loop on the second line - so just skip that first header with something like:
Colin
Thank you, Colin. This solution is work, but crash the search inputs for other columns.
We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.
Cheers,
Colin