Expand my Community achievements bar.

Expanding drop down boxes

Avatar

Former Community Member

Hi,

I was just wondering if there is a way to make a drop down box expand to fit all text once clicked.I have a drop down box with limited space and when I click it I cant see the entire width of the text.I am assuming a simple script would fix this?

Thanks!!!!

15 Replies

Avatar

Former Community Member

Someone must know this.Click a drop down box and it expands according to the width of the text?

Avatar

Level 5

At the moment I see only this. Please copy this in the EXIT-Event.

if(this.rawValue == 1)

{

    this.w = "50.5mm";

}else

{

    this.w = "100.5mm";

}

Kind regards Mandy

Avatar

Former Community Member

Thanks for the reply but I just tried this and nothing happened.

Avatar

Level 5

Do you activated the "Specify Item Value"?

  • Only then you can ask for 1 and 2...

When you don't activated this, you have to ask in the script for the entry. For example:

  • When your first entry in the DD is "Washington D.C.".
  • When your second entry in the DD is "NewYork".
  • Then you have to ask for them.

if(this.rawValue == "Washington D.C.")
{
    this.w = "100.5mm";
}else
{
    this.w = "75.5mm";
}

Naturally you have to adapt the script for your PDF.

Kind regards Mandy

Avatar

Former Community Member

I clicked specify item value but still not working.

Avatar

Level 5

Could you make a screenshot from your hierachy and he binding. Then I take a look.

Please take a look to my screenshot. It works fine.

dd.jpg

Avatar

Former Community Member

Hi,I tried your example but the box didnt expand.Maybe I didnt explain it right.I want the box only to expand to the width of the text when I click the arrow down then go back to its original size when I unclick it.Hope that makes sense.Thanks!!!!

Avatar

Level 5

The only thing is..

Use this in the mouseEnter-Event (you could use also in, mm, cm)

this.w = "100.5mm";

And use this in the mouseExit-Event. (this. vlue should be the dropdown width bevor you click in it)

this.w = "50.0mm";

Helpful?

Avatar

Former Community Member

Thanks but its not quite what I am looking to do.

I am hoping to be able to click the down arrow on the drop down box and have it expand while showing the entire contents on the drop down.I would like to do this with a single click.Hopefully this is possible.

Thanks!!!

Avatar

Level 5

Sorry, but I don't think so. The only thing which you can try it is copy the first script in the enter-event an d the seond script in the exit event.

There are not more possibilities.

Avatar

Former Community Member

So the width can be changed but not the length?

Avatar

Level 5

There aren't a property "length" for objects. Only width and height.

There are the property "length" only for the (entry)value.

Avatar

Former Community Member

Ok thanks,

So what can I do to change the height?

Thanks

Avatar

Former Community Member

One more question please.

Is there a way to make the drop down box go back to its normal size once an item in the drop down is selected or if a user clicks elsewhere?

Right now under the click event I selected : this.w ="5cm"; but it remains that width even after I select an item.

Thanks!!!!

Avatar

Former Community Member

I am getting close.

I used the event enter and event exit and did the following:

event enter

this.w="3inch";

this.length="5inch";

event exit"

this.w="1.5inch";

this.length="1inch";

The problem with this is although it expands the box and brings it back to its original size but when it expands in length and width it only expands the box and not the contents within the box.Is there a way to do this so it also displays the contents?

Thanks!!!