Quando eu integrar jQuery DataTables filtro de coluna e agrupamento linha , jQuery filtro DataTables coluna não está funcionando.
Tentei a demonstração mas parece no filtro coluna de demonstração também não funciona.
Quando eu integrar jQuery DataTables filtro de coluna e agrupamento linha , jQuery filtro DataTables coluna não está funcionando.
Tentei a demonstração mas parece no filtro coluna de demonstração também não funciona.
SOLUÇÃO
Plug-ins Row Agrupamento juntamente com filtragem de colunas não estão mais sendo desenvolvido, eu não recomendo usá-los. Use opções DataTables e métodos de API para executar agrupamento de linha e coluna individual de busca, como mostrado na linha de agrupamento exemplo e coluna procura exemplo individual .
// 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({
"order": [[2, 'asc']],
"drawCallback": function (settings){
var api = this.api();
// Zero-based index of the column for row grouping
var col_name = 2;
// If ordered by column containing names
if (api.order()[0][0] === col_name) {
var rows = api.rows({ page: 'current' }).nodes();
var group_last = null;
api.column(col_name, { page: 'current' }).data().each(function (name, index){
var group = name;
if (group_last !== group) {
$(rows).eq(index).before(
'<tr class="group"><td colspan="6">' + group + '</td></tr>'
);
group_last = group;
}
});
}
}
});
// Apply the search
table.columns().every( function () {
var that = this;
$( 'input', this.footer() ).on( 'keyup change', function () {
if ( that.search() !== this.value ) {
that
.search( this.value )
.draw();
}
} );
} );
DEMONSTRA
Veja este jsFiddle para o código e demonstração.