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
ashisbiswas
Posts: 1Questions: 1Answers: 0
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.
This discussion has been closed.
Answers
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
The number of
tfoot
columns doesn't match the number ofthead
columns. That is likely the issue.Kevin
For me the solution was to remove the line break tag in <tfoot><tr></tr></tfoot>
I too faced same issue. I missed adding th column in table. Thanks @kthorngren
I had the same issue. tfoot had a missing th.