Piyush Giri
Piyush Giri

Reputation: 91

flex combobox customize problem

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.

Upvotes: 1

Views: 908

Answers (1)

Arno
Arno

Reputation: 514

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.

Upvotes: 1

Related Questions