Expand my Community achievements bar.

Expand To Fit for Drop-down list

Avatar

Former Community Member

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

Former Community Member

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.