How to Resize Panel dynamically when fields inside are set via javascript

  • 2 September 2016
  • 9 replies
  • 134 views

Badge +1

Hello,

I have a panel with label inside it which is supposed to display different messages based on other field selection on form. Although panel is set to resize automatically, when value of the label inside the panel is set via javascript, it shows scrollbar instead resizing to show whole message. Can anyone help me with this issue?


9 replies

Userlevel 5
Badge +14

you can achieve that by a following call

NWF.FormFiller.Functions.ProcessFillerControl(NWF$('.theLabelClass'), NWF$('.formFillerDiv') ) 
Badge +1

That was it. Thank you very much Marian.

Badge +7

Hi Marian,

How would I modify this to work in my scenario below. I can't seem to get the space to grow based on how big the table is in the multiple lines of text control.

Userlevel 5
Badge +14

please post new question.

it's completelly diferent type of control, so it might need completelly different approach.

futhermore, afaik, multiline text control tends to show scrollbars in new/edit mode instead of resizing itself. so, I'm not sure whether it will be (easily) achievable.

Badge

Hi Marian, in my case I have two panels inside the inner panel I set a tables that built using javascript the number of table depend on the number of row in the repeating section. Where and how can I call this function to prevent scrollbar to appear when the number of tables become more than the height of the panel ?

Userlevel 5
Badge +14

I'm sorry ‌ I do not follow your setup.

can you create new question and post some examples/screenshots?

what you mean with "tables"? is it repeating section? how "tables" are related to panels?

please explain all these in new question.

Badge

Thanks for your consideration.

Please find the attached picture that has a screenshot with explanation for my issue. I tried to set the height for the panel dynamically according to number of rows . I got the number of item in the collection variable then multiply this number with the height of table then set the height of panel according to that height like this :

var height = collVar.length ;

document.getElementsByClassName("PanelClass").style.height=Classheight+ 'px';

but this solution didn't work.

Thanks again.

Badge +1

i try this but not work for me.I have label which its value set by JavaScript on run-time and this label inside a panel which also auto resized 

NWF.FormFiller.Events.RegisterAfterReady(function () {NWF.FormFiller.Functions.ProcessFillerControl(NWF$('.attachmentField'), NWF$('.formFillerDiv') ) ;
});

Userlevel 5
Badge +14

see solution provided here

https://community.nintex.com/message/84988-resize-panel-that-have-auto-resize-label-in-javascript#comment-85388 

Reply