代码之家  ›  专栏  ›  技术社区  ›  seismael

flex树披露者图标问题

  •  0
  • seismael  · 技术社区  · 16 年前

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

    2 回复  |  直到 16 年前
        1
  •  1
  •   Robusto    16 年前

    commitProperties 而不是 updateDisplayList

        2
  •  0
  •   seismael    16 年前

    找到了解决办法

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

    推荐文章