lado do servidor jquery datatables - coluna de filtro na parte superior
Olá, preciso mover na parte superior a coluna de filtro em meus JQUERY DATATABLES 1.10.10 Eu tenho a coluna de filtro na parte inferior:
$("dtabledID thead th").each( function () {
var title = $(this).text();
$(this).html( "<input type=\"text\" placeholder=\"Search "+title+"\" />" );
} );
E um clássico:
// 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();
} );
} );
Minhas DataTables usam a função scrollX e scroolY ... e o conteúdoé gerar do lado do servidor, e todos funcionam corretamente ..o filtro também.
Preciso mover o filtro por cima (depois ou antes) do título (TH e THEAD)
Eu tentei muitas soluções sem sucesso, por exemplo:
Adicionar colunas TD no THEAD não trabalhe
<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();
});
});
Solução CSS: não trabalhe
tfoot {
display: table-header-group;
}
alguma sugestão?