views:

57

answers:

1

I have a tree being populated by an array collection. I don't have control of the data in the array collection and even when a node has no children it still has a "children" property that is causing my tree to treat every node as branch. I can do a simple check on the length of the array in the children property. If this is 0 I need the tree to display the node as a leaf, no disclosure icon. Any thoughts on how I can achieve this? It would be nice if there were a branchFunction like the iconFunction and labelFunction.

Thanks in advance

+2  A: 

There is a dataDescriptor property that allows you to provide a class to determine how nodes and branches are parsed. You will need to implement the ITreeDataDescriptor or ITreeDataDescriptor2 interface.

CookieOfFortune
still kinda new to flex, can you point me to a tutorial or something on how to do that?
invertedSpear
Adobe Livedoc: http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_6.html
CookieOfFortune
OK I think I see, I'm going to have to create my own data descriptor, I can't just change a property in the default. Will have to play around with that. Thanks Cookie.
invertedSpear