Cannot read property 'nodeName' of null When I am adding row in tfoot

Cannot read property 'nodeName' of null When I am adding row in tfoot

ashisbiswasashisbiswas Posts: 1Questions: 1Answers: 0
edited July 2018 in Free community support

here is my html

<!--Table-->
<table id="popuTable" class="table table-striped table-bordered" style="width:100%">

    <!--Table head-->
    <thead>
        <tr>
            <th>No</th>
            <th>PU No.</th>
            <th>PU Description</th>
            <th>Unit</th>
            <th>Rate</th>
            <th>PU Rate (RM)</th>
            <th>Inst. QTY (UNIT)</th>
            <th>Inst. Value (RM)</th>
            <th>Value (%)</th>
            <th>Claimable (RM)</th>
            <th>Scope</th>
            <th>Action</th>
        </tr>
    </thead>
    <!--Table head-->

    <!--Table body-->
    <tbody>

    </tbody>
    <!--Table body-->

    <!--Table Footer-->
    <tfoot>
        <tr></tr>
    </tfoot>
    <!--/Table Footer-->

</table>
<!--Table-->

Here is my jquery code

//project popu table
var popuTable = $('#popuTable').DataTable( {
    "responsive": true,
    "processing": true,
    "serverSide": true,
    "pageLength": 50,
    "ajax": {
        "url":  "<?php echo base_url('admin/list-pupo');?>",
        "type": "POST"
    },
    "ordering": false
});

I am using server side. It is working fine, but when I add <tr></tr> in <tfoot>, I am getting error. But if <tfoot> is blank its woring fine. Here is the error.

What is the exact problem? Thanks in advanced.

Answers

  • colincolin Posts: 15,142Questions: 1Answers: 2,586

    Hi @ashisbiswas ,

    There's not information there to go on, I'm afraid. We're happy to take a look, but it would help, as per the forum rules, if you could link to a running test case showing the issue so we can offer some help. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • kthorngrenkthorngren Posts: 20,275Questions: 26Answers: 4,765

    It is working fine, but when I add <tr></tr> in <tfoot>, I am getting error

    The number of tfoot columns doesn't match the number of thead columns. That is likely the issue.

    Kevin

  • Mr_CifrasMr_Cifras Posts: 1Questions: 0Answers: 0

    For me the solution was to remove the line break tag in <tfoot><tr></tr></tfoot>

  • vssainivssaini Posts: 1Questions: 0Answers: 0

    I too faced same issue. I missed adding th column in table. Thanks @kthorngren

  • elhagenelhagen Posts: 1Questions: 0Answers: 0

    I had the same issue. tfoot had a missing th.

This discussion has been closed.