Uncaught TypeError: Cannot set property 'nTf' of undefined

Uncaught TypeError: Cannot set property 'nTf' of undefined

vishalsingh119vishalsingh119 Posts: 6Questions: 2Answers: 0

i know why ntf error coming because of lot of th/td in tfoot.I want th/td in tfoot, any other solution so i remove this error from datatables

Answers

  • vishalsingh119vishalsingh119 Posts: 6Questions: 2Answers: 0

    i try to remove th and td then alignment and sorting icon issue will occur.

  • vishalsingh119vishalsingh119 Posts: 6Questions: 2Answers: 0

    Issue if remove th from tfoot

  • vishalsingh119vishalsingh119 Posts: 6Questions: 2Answers: 0

    This is my code for datatable----

    var $oTable= $('#report_summary').dataTable({
    "order": [[ 1, "desc" ]],
    "scrollY":"250px",
    "scrollCollapse": true,
    "responsive": true,

        initComplete: function () {
            var api = this.api(); 
            api.columns().indexes().flatten().each( function ( i ) {
                var column = api.column( i );
                var select = $('<select><option value=""></option></select>')
                    .appendTo( $(column.footer()).empty() )
                    .on( 'change', function () {
                        var val = $.fn.dataTable.util.escapeRegex(
                            $(this).val()
                        );
                        column
                            .search( val ? '^'+val+'$' : '', true, false )
                            .draw();
                    } );
                column.data().unique().sort().each( function ( d, j ) {
                    select.append( '<option value="'+d+'">'+d+'</option>' )
                } );
            } );
        }
    }).columnFilter({ sPlaceHolder: "head:before",
            aoColumns: [ null,
                     { type: "date-range" },
                     null,null,null,null,null,null,null,null
                ]
        });
    
This discussion has been closed.