Is there a particular reason you're using Javascript and not the native rules engine? The native rules are able to resize the form for you when panels are displayed and hidden and would be less upkeep/overhead.
Yes, we originally set up rules to handle this but the performance was poor (This is a large form). That is why I am writing everything out in JavaScript.
From reading around it seems that I might be able to use this
it might have helped with shrinking empty space, but it again employs all the nintex' handling around showing/hiding/resizing all the controls on the form. the same is called behind the scene when rules are applied.
so why do you expect it will be faster this way?
I would say performance bottleneck is caused by all these rendering related recalculations
pure evaluation of formatting formulas is much faster.
if it is really complex form, I would say you will not gain too much if you reimplement all the logic on your own.
I must agree with on this. While the built in handling of resizing / repositioning code certainly has its fair share of mistakes, the rules system checks don't add a ton of overhead to what you'd like to accomplish.
That being said, if you insist on resizing the form yourself, it's nothing more than repositioning the top positions (NWF$(element).css("top")) of the elements below the thing you are either showing or hiding, and changing the overall height of the by the height of the toggled control.
Something like :
outerDiv.height(outerDiv.height() + toggledControlHeight);
container.height(outerDiv.outerHeight());
should get you started down that path of sorrow.