Thank you. I am unclear on where the classes QueryBuilderTreeDelegate and ReferenceDataBrowserDelegate are supposed to be.
I realize that I can implement ITreeDataDescriptor and use getChildren() to provide the children of any given node. What I don't know how to do is fetch a node's child data asynchronously from the server. getChildren() has to return something right away, so what does the callback function (from the asynchronous server call) do? Should it fire an event to the tree? If so, which one? Dan --- In flexcoders@yahoogroups.com, "Johannes Nel" <johannes....@...> wrote: > > Implement ITreeDataDescriptor and set the tree's data descriptor > thus every time you open a node you call the getChildren function of your > data descriptor > a simple example > > internal class ReferenceDataDescriptor implements ITreeDataDescriptor > { > private var __delegate:QueryBuilderTreeDelegate; > > public function > ReferenceDataDescriptor(delegate:QueryBuilderTreeDelegate) > { > __delegate = delegate; > } > > public function getChildren(node:Object, > model:Object=null):ICollectionView > { > var referenceDataDelegate:ReferenceDataBrowserDelegate = > __delegate.referenceDataDelegate > var gt:GenericTable = GenericTable.... > .... > > } > then store the data i get back in a hash table > > so hash['a\b'] = ArraycCOlleciton > > for local caching. > > > On Tue, Dec 9, 2008 at 4:04 AM, dandante <danda...@...> wrote: > > > Hello, > > > > I have a Tree control and I want to load each node's children in "lazy" > > fashion--that is, when > > the user expands a node, I want to fetch that node's children from the > > server. (there is way > > too much data to populate the entire tree ahead of time). > > > > I've looked around and the closest I came to a solution is this old post: > > http://www.mail-archive.com/flexcoders@yahoogroups.com/msg62360.html > > > > This code works, but it seems that it will only modify the children of the > > root nodes. It isn't > > clear how to expand this code to work with a deep tree. > > > > Does anyone have ideas on that, specifically, or on other approaches to > > this problem? > > Thanks > > > > > > > > > > -- > j:pn > \\no comment >