Adjust height of a control automatically

  • 17 November 2014
  • 2 replies
  • 2 views

Badge +2

Hello,

 

I'm using K2 smartforms and i have a problem with expanding automatically the "Memo" control. The smartforms only allows me to set the height of the memo in pixels, which I'd like to avoid as I want to display the whole content without scrolling.

Is there a way to increase the height of the controll when the user adds more content? (some rule maybe?)

 

Cheers and thanks in advance for hints :)

Wojtek


2 replies

Badge +10

Hi Wojtek,

 

There is a rule action called "Set a control's Properties" which will allow you to set the height of a control.

You can create a rule which executes when the text area is changed and then have the height of your control adjusted.

The rule cannot adjust the height automatically so you might need to have a Data Label that calculates what the height should be based on the text entered and then use this Data Label's value to set the height of the control.

 

I hope this helps!

Regards,

JohanL

Badge +2

Hello,

 

I tried to do something like this, but i had problems with calculating the height of the text (especially that there may be some images). Finally i added 2 buttons to increase and decrease the height of the control manually. This is no a nice solution, but probably I'll have to use it :(

 

Cheers,

Wojtek

Reply