Sribin Sribin - 2 months ago 10
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.


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 () {

} );