开发者

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开发者_StackOverflow contains a children array of length 0, or null......


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


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

}

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜