1

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.

1 Answer 1

1

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.

1
  • 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. Jul 15, 2009 at 9:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.