Flex树披露者图标问题

发布于 2024-09-16 15:52:08 字数 131 浏览 1 评论 0原文

我给了树一个 ArrayCollection 作为我从数据库中提取的数据提供者,它包含子项,但披露者图标不会在没有子项的对象上消失。

我认为问题在于渲染器无法识别叶子子节点,其中包含长度为 0 或 null 的子节点数组......

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

行至春深 2024-09-23 15:52:08

也许您可以在 commitProperties 而不是 updateDisplayList 中尝试您的解决方案?

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

胡大本事 2024-09-23 15:52:08

找到了解决方案

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

}

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

}

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文