tags:

views:

19

answers:

2

Hi,

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......

A: 

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; 
        }

}

seismael
+1  A: 

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

Robusto
hii, could you explain to me why is that??? what is the deffrence if both works? its very important to me because the performance is tooo bad for the tree now... its not the only change i did in update function
seismael