views:

515

answers:

1

Hi All , I'm new to flex and i need to create item and subitems in combobox, where only subitem is clickable. similar to what is shown in the given link as under: http://blog.flexexamples.com/2007/09/25/creating-a-custom-combobox-item-renderer-in-flex/ but here both header and option are clicked at the same time whereas i need that only option should be clickable Is there any way to do the same. PLease help. Thanx in advance.

A: 

The combobox that you want is just a normal combobox only the items are visually different.

So when you get the data inside your itemRenderer with:

  override public function set data(value:Object):void
        {
            super.data = value; 
                if (data.isChild == false){
                    this.mainLabel.setStyle("fontWeight","bold");
                }else if (data.isChild == true){
                    this.mainLabel.setStyle("fontWeight","normal");
                }
        }

You call a function that checks if a boolean in that data is true or false. If it is false a Label is bold. If trueLabel is normal.

But for this solution you have to have access to the data that you get.

Arno
thanx for comment Arno but this is not something which i'm looking for actually i need to create submenus in combobox where the header option should not be clickable.
Piyush Giri