2 Replies Latest reply on Nov 16, 2010 10:38 AM by -skitch-

    Tree Item Renderer roll up issue

    -skitch-

      I have a tree item renderer thats pretty custom, basically copied all the code from TreeItemRenderer.as and modified it to display my own components.  Everything is working fine, except when I click my disclosure icon to roll up the tree leaves, the branch below the tree leaves tends to roll up halfway into the branch that was rolled up.  Is there a workaround for this?

       

      I think it might have to do with the measure function, but not too sure.

       

              //----------------------------------
              //  measure
              //----------------------------------
              /**
               *  @private
               */
              override protected function measure():void
              {
                  super.measure();
                 
                  var w:Number = _data ? _listData.indent : 0;
                 
                  if (disclosureIcon)
                      w += disclosureIcon.width;
                 
                  if (imageCanvas && imageCanvas.visible)
                  {
                      w += imageCanvas.width;
                      measuredHeight = imageCanvas.height + 10;
                  } else if(description && description.visible) {
                      measuredHeight = title.getExplicitOrMeasuredHeight() + description.getExplicitOrMeasuredHeight() + 2;
                  } else {
                      measuredHeight = title.getExplicitOrMeasuredHeight() + 2;
                  }
                  if (title)
                      w += title.textWidth;
                 
                  measuredWidth = w;
              }