--- In [email protected], "Tracy Spratt" <tspr...@...> wrote: > > Amy, I have never worked with "HierarchicalCollectionView". What are > its advantages over e4x XML? Is it mainly integration with > AdvancedDataGrid?
It is part of DataVisualization, yes, but you don't have to use it with ADG. The main thing you have to remember when you _don't_ use it with ADG is that you still have to open and close the nodes as if you were visually looking at the data in a tree rather than just using it to hold tree data. If you're working with a client, for instance, who feels that it's unwise to build and provide an entire XML structure at once (because of the size of the data set or maybe someone's not comfortable with recursion) and instead wants to provide typed objects via AMF and have the client side predictively load the children, this is one way to handle the situation. You can pretty much instantly get back the top level of objects and display them to the user, while in the background you iterate down the line and call each typed object's loadChildren() method so that the chances that the next level of data will be ready when the user clicks on it get better and better the longer the user takes looking at the current level. Of course you need to provide an override where if the user clicks something that hasn't yet been loaded you go get it then. Possibly you could handle this situation with XML, but I'd think it would be clunky. But what HierarchicalCollectionView gives you relative to other ways you might use ArrayCollections is a clean way to get back from the child to the parent. And of course you can cast XML to this data type, but I'm not sure it gets you anything outside of ADG. I personally really wish they had associated the summary type functions with this data type rather than directly with the GroupingCollection, because then you'd be able to use Summary functions on anything that implements IHierarchicalData. I also think there's a chance that you could do something similar with a DataDiscriptor, but I'm not sure. -Amy

