Here is an example of a TreeItemRenderer.  It adds lines between sibling nodes, 
and properly uses CommitProperties and UpdateDisplayList.

 

It is a good start for adapting to your own use.

http://www.cflex.net/showFileDetails.cfm?ObjectID=575

 

It is Flex 2, might need some adjusting for Flex 3.

 

Tracy

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of S B
Sent: Wednesday, June 18, 2008 2:20 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Tree itemRenderer not displaying as a tree?

 

How can I fix that?

Or, how can I change each node's label based on two attributes in the XMLList?

----- Original Message ----
From: Alex Harui <[EMAIL PROTECTED]>
To: flexcoders@yahoogroups.com
Sent: Wednesday, June 18, 2008 10:43:22 AM
Subject: RE: [flexcoders] Tree itemRenderer not displaying as a tree?

Because indentation is handled by the renderer and label doesn’t know how to do 
that.

 

________________________________

From: [EMAIL PROTECTED] ups.com [mailto: [EMAIL PROTECTED] ups.com ] On Behalf 
Of S B
Sent: Wednesday, June 18, 2008 9:51 AM
To: [EMAIL PROTECTED] ups.com
Subject: [flexcoders] Tree itemRenderer not displaying as a tree?

 

Why doesn't the following mx:Tree display as a tree? Instead, all nodes have 
the same indentation for some reason. Thanks!

    <mx:XMLList id="xml_tree_ legend_data">
        <node label="Medication" short="med">
            <node label="Quantity" short="qty"/>
            <node label="Unit" short="unit" />
            <node label="Adminstratio n method" short="amethod" />
            <node label="Frequency" short="frequency" />
            <node label="Core" short="core" />
        </node>
    </mx:XMLList>

     [...]

                    <mx:Tree id="tree_legend" dataProvider= "{xml_tree_ 
legend_data} " alternatingItemColo rs="['#fffffc' , '#ededed']" width="100%" 
height="100% "> <mx:itemRenderer>
                            <mx:Component>
                                <mx:Label text="[{data.. @short.toUpperCa 
se()}] [EMAIL PROTECTED] "/>
                            </mx:Component>
                        </mx:itemRenderer>
                    </mx:Tree>

 

 

 

Reply via email to