Add footer rows dynamically as per data array

Add footer rows dynamically as per data array

networkadmin@asaiatm.comnetworkadmin@asaiatm.com Posts: 8Questions: 4Answers: 0

I have a map where i get a multiple key-value pair and I need to display these as a summary in the footer.

I did tried to append to tfoot but its not getting displayed in tfoot dynamically

"footerCallback": function (row, data, start, end, display) {
var api = this.api();
for (let [key, value] of newMap) {
//add tfoot rows here dynamically
$('#tableShiftSummaryFooter').append('<tr><td>test</td></tr>');
}

}

Answers

  • networkadmin@asaiatm.comnetworkadmin@asaiatm.com Posts: 8Questions: 4Answers: 0
    edited January 25

    just to add there has to be multipel TR and not a single TH

  • allanallan Posts: 63,441Questions: 1Answers: 10,465 Site admin

    Footer cells and rows in the DataTable cannot be added after initialisation. They need to be present when the table is initialised.

    Allan

Sign In or Register to comment.