Hi, I'm currently able to build up an array of totals for all of my filtered rows, using the underscore:
However, with this array of new values I can't figure out how to add a new tfoot row.
I don't want to just append with jQuery as our system also allows dynamic hiding of columns (e.g. for smaller screens) so we would like datatables to be in control of the new footer row (in the same way that it takes care of hiding columns in the existing footer row)
Any ideas?
var totals = ['Filtered Totals:']; var rows = table._('tr', { "filter": "applied" }); $(table.fnSettings().aoColumns).each(function (index, value) { var col = $(this.nTh); var total = null; if (col.data('total-type') == 'sum') { total = 0; for (var i = 0; i < rows.length; i++) { total += parseInt(rows[i][index]); } } totals.push(total); });
However, with this array of new values I can't figure out how to add a new tfoot row.
I don't want to just append with jQuery as our system also allows dynamic hiding of columns (e.g. for smaller screens) so we would like datatables to be in control of the new footer row (in the same way that it takes care of hiding columns in the existing footer row)
Any ideas?