Skip to main content

Hello,

I have a form with multiple panels. I am using javascript to set the display to none of these panels, document.getElementsByClassName(AllPanels)[0].style.display = "none"; Then when a checkbox is clicked it opens the desired panel, document.getElementsByClassName(panel.style.display = "block";

Now I want the form to resize so that there isn't a large space between the checkboxes (I attached an image). 

From reading around it seems that I might be able to use this:  NWF.FormFiller.Functions.ProcessFillerControl(NWF$('.labelName'), NWF$('.formFillerDiv') )  but I havent gotten it to work.

Thank you

Sean

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.


Bump Bump


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. 


Reply