0

I'm using alfa jango dynatable plugin to render my tables but now I need to show total (sum) of a specific column.

The idea is to insert a new row with a cell with the total of the column per page.

Can anyone help me with this question?

Edit:

I'm trying this solution

https://github.com/alfajango/jquery-dynatable/issues/76

var dynatable,
    $myTable = $('#my-table');

$myTable.bind('dynatable:afterProcess', function(e, data) {
  var total = 0,
      records = dynatable.settings.dataset.records;

  for (var i = 0; i < records.length; i++) {
    total += records[i].myAttribute || 0;
  }

  $myTable.find('tbody').append('<tr><td colspan=4>Subtotal:</td><td>' + total + '</td></tr>');
});

$myTable.dynatable();

But dynatable.settings.dataset.records is undefined

0 Answers0