Expand my Community achievements bar.

Dynamically increase the table row

Avatar

Level 3

Trying to increase the rows of a table dynamically, seems like the rows are increased and values assigned to the column. Able to verify these with the alert statement. But when form is rendered, no additional rows are displayed.

 

Used the following java script in the initialize event of the table.

Please let me why the newly added rows are not showing up.

 

RootForm.Page2.Table7::initialize -

var rowLength=xfa.resolveNodes("xfa.datasets.data.root.parentNode[*]").length;
//app.alert(rowLength);
for(var index=0; index < rowLength; index++){
//app.alert(index);
var oRowInstance=RootForm.Page2.Table7.resolveNode("Row1[" + index + "]");
oRowInstance.Cell1.rawValue="10";
oRowInstance.Cell2.rawValue=18;
//app.alert(oRowInstance.Cell1.rawValue);
//app.alert(oRowInstance.Cell2.rawValue);
oRowInstance.instanceManager.addInstance(true);
xfa.form.recalculate(true);

}

 

Thank you

 

3 Replies

Avatar

Employee Advisor

@Eshwarign Make sure the max count is set for the row that will be repeated and the panel is flowable

Avatar

Level 3

It is set as mentioned, 'repeated row each data item' min count as 1 and Max is not set, and the sub form is flowable. Still only one row is showing up. I even tried to set the visibility of the column. But the same result.

Avatar

Level 10

The line xfa.resolveNodes("xfa.datasets.data.root.parentNode[*]").length; is nonsense, as it simply resolves xfa.datasets.data which is always a single node.

 

What exactly are your trying to do with you table?