Ah, I see what you mean.
Tracy - yea, i realized my goof on that one after I sent the message
(XML and XMLList are interchangeable for Tree). Thanks for keeping me
in check. :)
Try the isBranch attribute for folders that you do not want the tree
to display. Then you can write a custom renderer for "leaf" nodes –
the tree will treat nodes with the isBranch flag set to false as leaf
nodes.
This shouldn't cause any problems with your datagrid.
Example as follows:
<mx:XMLList id="treeData">
<folder label="Accounts">
<folder label="First Account">
<folder label="Inbox" isBranch="false">
<message label="Flexcoders"/>
<message label="Flashcoders"/>
<message label="Flashnewbie"/>
</folder>
<folder label="Send Items" isBranch="false">
<message label="Nested Tree e4x"/>
</folder>
<folder label="Trash" isBranch="false">
<message label="Flashnewbie"/>
</folder>
</folder>
<folder label="Second Account">
<folder label="Inbox" isBranch="false">
<message label="New Messages"/>
<message label="Flagged Items"/>
<message label="Attachments"/>
<message label="All Mail"/>
</folder>
<folder label="Send Items" isBranch="false">
<message label="Tree Data Provider with e4x"/>
</folder>
<folder label="Trash" isBranch="false">
<message label="Lame Yahoo HTML emails"/>
</folder>
</folder>
</folder>
</mx:XMLList>
On May 18, 2007, at 12:27 PM, Richard Rodseth wrote:
Thanks, Jon. Your example works for me, but I also need to add
"message" leaf elements, and exclude those from the tree.
i.e.
<mx:XMLList id="folders">
<folders>
<folder name="account1">
<folder name="Inbox">
<message name="Greetings">
</message>
</folder>
</folder>
</folders>
</mx:XMLList>