Sribin Sribin - 1 year ago 147
Javascript Question

How to insert columnfilter in bootstrap datatable

I have bound my html table with datatable and the functionalities such as searching, paging and sorting are working fine. But when I tried to implement the column filter using


it doesn't work. It shows an error saying

columnFilter is not a function.

Answer Source

I have done it in a different way.

$('#demo-dt-basic thead tr th').each(function (i) {        
        var title = "Search "+$(this).text();

        $("<input class='form-control input-sm' type='text' placeholder='" + title + "'/>").appendTo($(this));
        table.columns().eq(0).each(function (colIdx) {
            $('input', table.column(colIdx).header()).on('keyup change', function () {

} );
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download