Avatar

Level 2

Hm I think I almost got it.

I added this to calculate event on the 3 total fields (just replace iznos with m2 and komada for the other 2).

var sum = 0;

var columnArray = xfa.resolveNodes( "master.Table3.Row1[*].iznos");

for( var i = 0; i<columnArray.length; i++)

{

    sum += columnArray.item(i).rawValue;

}

this.rawValue = sum;

And then I added this to Table3.Row1 indexChange event.

// Revalue the weight if we delete one of the subform instances or add another subform in the middle

this.rawValue = this.parent.instanceIndex + 1;

// Fix for listener problem

master.Table3.Row1.execCalculate();

But the problem is... it recalculates the values for the first row. But when I add the second it doesnt add it to the total fields.

Here's that version of the PDF.

udrugasasrcem.com/test5.pdf