I am having a form which has a performance issue due to script in layout:ready event for 3 of the fields and these are fired more often. These 3 fields require height adjustment during form runtime when one add/remove a repeatable subform. Form have 3 nested repeatable subforms, third nesting in second and second nesting in first. So when the form grows near to 1 page size or more, performance hitting starts. Even exiting a text fields take 3-4 seconds.
So I want an alternative approach to set heights of these 3 fields or code for height adjustment run only when any of the 6 Add/Remove buttons is clicked. Some time I have to click a button having xfa.layout.relayout(); under click event to correct layout. I have attached two images for better understanding for hierarchy.
Thanks for your reply, I tried this way on my form but sometime removing an instance messed up table lines. See below.
However, I found a way to improve the efficiency to its best. I put the code under add and remove buttons to increase/decrease the parent subforms height by that of their child objects. It improved the efficiency very much,
You will probably have better performance using nested tables instead of nested subforms. Nested tables will resize the adjacent cells automatically. The exception is with your image field, but do you really want the image distorted ... I assume you have the image field set to "Scale image to fit rectangle".