Calulating totals for multiple columns through fnFooterCallback()

Calulating totals for multiple columns through fnFooterCallback()

ymagasheymagashe Posts: 20Questions: 0Answers: 0
edited November 2009 in General
Hello,

I will like to calculate totals for 3 of my columns and display it below respective column in footer. I see that via fnFooterCallback() there is provision to show only 1 at the moment.

There is a thread in which bjenkins has tried to do similar thing. However, I couldn't do the same in my code.
http://datatables.net/forums/comments.php?DiscussionID=566&page=1#Item_2

Is there any way i can accomplish the same? Has anyone tried it before?

Thanks so much.

Sincerely,
Yogesh

Replies

  • santiagozkysantiagozky Posts: 8Questions: 0Answers: 0
    I actually have. I did it just yesterday. this is how I did it for two columns

    [code]
    function (nRow, aasData, iStart, iEnd, aiDisplay ) {
    $($(nRow).children()).remove();
    for(var i=0;i
  • ymagasheymagashe Posts: 20Questions: 0Answers: 0
    hi santiagozky ,

    Thanks so much. Exactly what I was looking for. Thanks again for providing the code snippet.

    Sincerely,
    Yogesh
  • PhenixPhenix Posts: 7Questions: 0Answers: 0
    edited October 2010
    thanks for this code ... i just put it into my table.

    but i corrected an error when search result is 0
    [code]
    function (nRow, aasData, iStart, iEnd, aiDisplay ) {
    $($(nRow).children()).remove();

    if(iEnd > 0) { // if search result is empty do nothing

    for(var i=0;i
This discussion has been closed.