include column 6 value in footer sum if column 3 and column 4 contain value

include column 6 value in footer sum if column 3 and column 4 contain value

banjomacmanbanjomacman Posts: 3Questions: 1Answers: 0

I'm trying to conditionally include a value in a sum for the footer if 2 other columns in the row contain values. I can't seem to work out the syntax. I'm wanting to do this in the footerCallback.

so the row has a total of 7 columns - if column 3 & 4 have values then include column 6 in the sum

This question has an accepted answers - jump to answer

Answers

  • colincolin Posts: 8,085Questions: 0Answers: 1,357

    We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

  • banjomacmanbanjomacman Posts: 3Questions: 1Answers: 0

    Here is a link to a test case illustrating the problem. Just let me know if more info is needed. Thank you!

    http://live.datatables.net/navekalo/1/edit

  • colincolin Posts: 8,085Questions: 0Answers: 1,357
    Answer ✓

    Thanks for that test case. You can use rows().data() for that - see your updated example here.

    Colin

  • banjomacmanbanjomacman Posts: 3Questions: 1Answers: 0

    Perfect! Exactly what I needed. Thank you!

Sign In or Register to comment.