Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Expand To Fit for Drop-down list

Avatar

Level 4

Hi All,

Why expand to fit option is disabled for drop-down list?

Is there any way to make the drop-down field expandable as per the data selected?

Thanks and Regards-

Chalukya

2 Replies

Avatar

Level 9

Hi Chalukya,

Though not sure, still I guess all the values in a dropdown are pre-existing or if we use dynamic properties to update the dropdown we can know atleast what could be it's length.May be that's the reason expand options are not available.

But if you want to expand it you can do so a bit of scripting.

When we select something from the dropdown through change event we can get the vairable length. If the variable/item length is greater than a particular value then we can expand the dropdown.

In the change event of the dropdown :

You have to use FormCalc if you want to use Len otherwise you can use an array in javascript.

if(Len($event.change))   > 10

     {

          this.w = "10inch";

     }

Thanks,

Bibhu.

Avatar

Level 4

Hi Bibhu,

Thanks for ur reply.

May be u r right about the expand to fit option for ddl.

Your code works fine with the field width to expand, but if we try to do the same with the height the field gets expanded height wise but the data does not wrap around.

I am trying to achive this by hiding the text field and ddl one behind the other.

Thanks a lot once again.

Regards-

Chalukya.