Hello I need to move on the top the filter column on my JQUERY DATATABLES 1.10.10 I have the filter column on the bottom:
$("dtabledID thead th").each( function () {
var title = $(this).text();
$(this).html( "<input type=\"text\" placeholder=\"Search "+title+"\" />" );
} );
And a classic:
// Apply the search column filters
table.columns().eq( 0 ).each( function ( colIdx ) {
$( 'input', table.column( colIdx ).footer() ).on( 'keyup change', function () {
table
.column( colIdx )
.search( this.value )
.draw();
} );
} );
My DataTables use scrollX and scroolY function...and the content is generate server-side, and all work correctly ..the filter too.
I have need to move the filter on top (after or berfore) the Title (TH and THEAD)
I have try many solutions without success, for example :
Add TD columns in THEAD dont work
<thead>
<tr><th>col1</th><th>col2</th></tr>
<tr><td>col1</td><td>col2<</td></tr>
</thead>
$(document).ready(function() {
$('#mytable thead td').each( function () {
var title = $('#mytable thead th').eq( $(this).index() ).text();
$(this).html( '<input type="text" placeholder="Search '+title+'" />' );
});
$("#mytable thead input").on( 'keyup change', function () {
table
.column( $(this).parent().index()+':visible' )
.search( this.value )
.draw();
});
});
CSS solution: don't work
tfoot {
display: table-header-group;
}
any suggestion?