I have a dynamic table that calculates the sum of all rows, no issue. I'm struggling with pulling out a subtotal though. I would like to have a check box in each row that flags those rows and gives the sum of their total. Any help would be greatly app

jasons17295687

07-05-2015

I have a dynamic table that calculates the sum of all rows, no issue.  I'm struggling with pulling out a subtotal though.  I would like to have a check box in each row  that flags those rows and gives the sum of their total.  Any help would be greatly appreciated.

Accepted Solutions (0)

Answers (1)

Answers (1)

jasotastic81

12-05-2015

762680_pastedImage_0.png

Here's something I threw together rq. The script is in the change event for the checkbox in the table. (Of course, you'll have to modify it to suit the names of your fields.)


var rows = xfa.resolveNodes("tblAmounts.Row1[*]");


var subtotal=0;


for (i=0; i<rows.length; i++) if (rows.item(i).cbAdd.rawValue == 1) subtotal = subtotal + rows.item(i).nfAmount.rawValue;


nfSubtotal.rawVlaue=subtotal;