using footercallback to calculate sumatory
using footercallback to calculate sumatory
santiagozky
Posts: 8Questions: 0Answers: 0
Hello datatablerers,
I want to use the fnFooterCallback to calculate the sum of some columns in my tables. The problem is that the order the rows are being showed does not correspond to the order of the data in the array.
Here is part of my code:
[code]
"fnFooterCallback": function(nRow, aasData, iStart, iEnd, aiDisplay ) {
//delete the footers
$($(nRow).children()).remove();
//recreate the footers
for(var i=0;i
I want to use the fnFooterCallback to calculate the sum of some columns in my tables. The problem is that the order the rows are being showed does not correspond to the order of the data in the array.
Here is part of my code:
[code]
"fnFooterCallback": function(nRow, aasData, iStart, iEnd, aiDisplay ) {
//delete the footers
$($(nRow).children()).remove();
//recreate the footers
for(var i=0;i
This discussion has been closed.
Replies
I just saw my error, I forgot to use aiDisplay as index for getting the data.
I just changed
[code] total=total+parseInt(aasData[i][3]);[/code]
to
[code] total=total+parseInt(aasData[aiDisplay[i]][3]);[/code]