Can i use tfoot property of table in JQuery Datatable

Can i use tfoot property of table in JQuery Datatable

KirangarwaKirangarwa Posts: 6Questions: 4Answers: 0

I have created one application. In that i have created a datatable. in that i want to use every column filter property. I referred the code from datatable forum. but i dont want to write tfoot property in my table intialization. Is it possible that i can use any inbuit datatable property ?

because if after some time if somebody wants to change or if any new column will add than he/she has to change only in jquery datatable function, not at both side in function and in table intialization.

Answers

  • KirangarwaKirangarwa Posts: 6Questions: 4Answers: 0
    edited April 2015

    I have used here tfoot but i want a alternative instead of it.

    $('#JdtLeads tfoot tr td').each(function () {
    var title = $('#JdtLeads tfoot tr td').eq($(this).index()).text();
    $(this).html('<input type="text" style="width:100%" placeholder="' + title + '" />');

        });
    
        // DataTable 
        var table = $('#JdtLeads').DataTable();  // Apply the search   
    
        table.columns().every(function () {
            var that = this;
    
            $('input', this.footer()).on('keyup change', function () {
                that
                    .search(this.value)
                    .draw();
            });
        });
    
This discussion has been closed.