seismael
seismael

Reputation: 227

flex tree discloser icon problem

i gave the tree an ArrayCollection as dataprovider that i pulled from the database, and it contains the children, but the discloser icon wont disappear on an object that doesn't have a child.

i think the problem is that the renderer doesn't recognize the leaf child, wich contains a children array of length 0, or null......

Upvotes: 0

Views: 452

Answers (2)

seismael
seismael

Reputation: 227

Found the solution

override update display list function at tree item renderer and check the data there, if it doesn't have children, make the discloser icon not visible.

override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
    {
        super.updateDisplayList(unscaledWidth, unscaledHeight);

        if ( null != data && (data.children.length <=0)
        {
            disclosureIcon.visible = false; 
        }

}

Upvotes: 0

Robusto
Robusto

Reputation: 31883

Maybe you could try your solution in commitProperties instead of updateDisplayList?

Upvotes: 1

Related Questions