isBranch didn't work?

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of djdyland
Sent: Friday, November 02, 2007 10:22 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: Tree: Removing expand triangle from select
nodes

 

Thanks for your help guys, Adding in a customITreeRenderer seems to 
fix the problem. It looks like this..

package
{
import mx.controls.treeClasses.*;
import mx.collections.*;

public class CustomTreeItemRenderer extends TreeItemRenderer
{
// Define the constructor. 
public function CustomTreeItemRenderer() {
super();
}

// Override the set method for the data property
// to set the font color and style of each node. 
override public function set data(value:Object):void {
super.data = value;
if(super.listData != null){
if(TreeListData(super.listData).hasChildren)
{
setStyle("fontWeight", 'bold');
}
else
{
setStyle("fontWeight", 'normal');
} 
}
}

// Override the updateDisplayList() method 
// to set the text for each tree node. 
override protected function updateDisplayList
(unscaledWidth:Number, 
unscaledHeight:Number):void {

super.updateDisplayList(unscaledWidth, unscaledHeight);
if(super.data)
{
if(TreeListData(super.listData).hasChildren)
{
var tmp:XMLList = 
new XMLList(TreeListData
(super.listData).item);
var myStr:int = tmp[0].children().length();
super.label.text = TreeListData
(super.listData).label + 
"(" + myStr + ")";
}
}
}
}
}

--- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
, "Tracy Spratt" <[EMAIL PROTECTED]> 
wrote:
>
> Here is one that draws lines between siblings, perhaps it will 
help you
> see what to do.
> 
> http://www.cflex.net/showFileDetails.cfm?ObjectID=575
<http://www.cflex.net/showFileDetails.cfm?ObjectID=575> 
> 
> Tracy
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of Tracy Spratt
> Sent: Monday, October 29, 2007 4:10 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: RE: [flexcoders] Re: Tree: Removing expand triangle from 
select
> nodes
> 
> 
> 
> A custom TreeItemRenderer?
> 
> Tracy
> 
> 
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>

[mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
] On
> Behalf Of djdyland
> Sent: Monday, October 29, 2007 3:43 PM
> To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> Subject: [flexcoders] Re: Tree: Removing expand triangle from 
select
> nodes
> 
> 
> 
> So I guess to simplify my question... how do I apply
> 
> myTree.setStyle("disclosureOpenIcon", null);
> myTree.setStyle("disclosureCloseIcon", null);
> 
> to individual nodes instead if the whole tree?
> 
> Anyone have any idea
> 
> --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> , "djdyland" <djdyland@> wrote:
> >
> > Hi, Thanks for the reply.
> > 
> > Like I said I have a ITreeDataDescriptor.
> > 
> > But I don't see how I can use that to disable the expand triagle 
> for 
> > certain nodes.
> > 
> > Thanks
> > Dylan
> > 
> > --- In flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> , "Alex Harui" <aharui@> 
wrote:
> > >
> > > Custom ITreeDataDescriptor
> > > 
> > > 
> > > 
> > > ________________________________
> > > 
> > > From: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> 
> > [mailto:flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com> 
> <mailto:flexcoders%40yahoogroups.com> ] On
> > > Behalf Of djdyland
> > > Sent: Monday, October 29, 2007 8:41 AM
> > > To: flexcoders@yahoogroups.com
<mailto:flexcoders%40yahoogroups.com>  <mailto:flexcoders%
40yahoogroups.com>
> 
> > > Subject: [flexcoders] Tree: Removing expand triangle from 
select 
> > nodes
> > > 
> > > 
> > > 
> > > Hello,
> > > 
> > > I'm building a scripting reference app that is populated from 
an 
> > XML 
> > > file. The structure is something like this.
> > > 
> > > <groupOfAssociatedClasses name="name of container">
> > > <class name="className">
> > > <property name="propertyName">
> > > <type>theType</type>
> > > </property>
> > > <method name="methodName">
> > > <inputType>type</inputType>
> > > <returnValue>value</returnValue>
> > > </method>
> > > </class>
> > > <class name="className">
> > > <property name="propertyName">
> > > <type>theType</type>
> > > </property>
> > > <method name="methodName">
> > > <inputType>type</inputType>
> > > <returnValue>value</returnValue>
> > > </method>
> > > </class>
> > > </groupOfAssociatedClasses>
> > > <groupOfAssociatedClasses name="name of container">
> > > <class name="className">
> > > <property name="propertyName">
> > > <type>theType</type>
> > > </property>
> > > <method name="methodName">
> > > <inputType>type</inputType>
> > > <returnValue>value</returnValue>
> > > </method>
> > > </class>
> > > </groupOfAssociatedClasses>
> > > 
> > > I created a tree discriptor to filter out all the children on 
> each 
> > > class so it doesn't display them in the tree. All I want to 
see 
> in 
> > > the tree is the names of the containers and the names of the 
> > classes.
> > > 
> > > My proplem is that beucase the classes have children flex is 
> > > displaying the expand node triangle beside the icon which ends 
> up 
> > > doing nothing becuase of the filter. How can I get rid of the 
> > expand 
> > > node triangle?
> > > 
> > > I tried to turn it off but it ended up turning it off for the 
> > parent 
> > > container nodes as well.
> > > 
> > > Any Help is much appreciated :)
> > >
> >
>

 

Reply via email to