Skip to content

Conversation

@ikarius6
Copy link
Contributor

After updating to last version of IgnitedDatatables, the useful plugin "ColumnFilter" stop working, so we can recovery the filter functions with:

var mytable = $('#mytable').DataTable({
... //server_side config
});

$('#mytable tfoot th').each( function () {
    var title = $('#mytable thead th').eq( $(this).index() ).text();
    $(this).html( '<input type="text" placeholder="Search '+title+'" />' );
});

mytable.columns().eq( 0 ).each( function ( colIdx ) {
    $( 'input', mytable.column( colIdx ).footer() ).on( 'keyup change', function () {
        mytable
            .column( colIdx )
            .search( this.value )
            .draw();
    });
});

And the code is not invasive, you can filter with search input and be more specific with individual column search inputs.

Motivation: https://datatables.net/forums/discussion/comment/64034/#Comment_64034

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant