I cant vouch for the ILog Elixir stuff.  There might be an easy way to do it.  
Assuming that doesnt suit your needs, I think you may need to massage your data 
a bit because I dont think the data descriptor alone will give you what you're 
looking for.

I'm assuming this is basically your desired tree structure:
-group1
--item
--item
-group2
--item
--item
-group3
--item
--item

Your probably going to need to put your data into a collection that looks like 
this:

var myCollection:ArrayCollection = new ArrayCollection([
{group:"group1", items:[item,item,item]},
{group:"group2", items:[item,item,item]},
{group:"group3", items:[item,item,item]}
]);

Then, you can use a dataDescriptor to tell the tree what properties of the item 
object you want to display.  The tree is packaged with a default 
dataDescriptor, so your data either has to conform to its conventions to 
display properly or you have to override it.

Implementing a very basic ITreeDataDescriptor and putting your debugger on it 
will give you valuable insight as to how the Tree component traverses a given 
data provider.  You can then tell the tree how to display the objects in your 
collection.  Hope that helps.

To anyone out there, iff there's an easier way to do it with the ILog stuff, 
I'd appreciate a link to it.  Thanks.


--- In flexcoders@yahoogroups.com, "cuttenv" <cutt...@...> wrote:
>
> You could use a grouping Collection to group the data. If you check out the 
> ILog Exlir stuff they have a bunch of demos on how to do this.
> 
> --- In flexcoders@yahoogroups.com, Alex Harui <aharui@> wrote:
> >
> > The dataDescriptor's purpose is to allow you to create a hierarchy out of 
> > flat data.
> > 
> > 
> > On 4/6/10 8:42 AM, "Phil Boissiere" <deletedfromyoutube@> wrote:
> > 
> > 
> > 
> > 
> > 
> > 
> > Thanks, Oleg, Jeff.
> > 
> > In reality the thing that comes back after querying my database is an 
> > ArrayCollection of strongly typed objects (value objects?). These objects 
> > have a linear (non-hierarchical) structure but I want to use one of the 
> > properties (the "group" property) for the parent nodes in a Tree component.
> > 
> > Should I be looking at creating a custom data descriptor or a custom object 
> > that implements the ICollectionView interface (does that mean create a 
> > custom Tree component?).
> > 
> > I just want to make sure I'm doing the right thing, since either approach 
> > seems to involve quite a bit of ActionScript.
> > 
> > Thanks again.
> > 
> > 
> > --- On Tue, 4/6/10, Jeff <britton.jeff@> wrote:
> > 
> > From: Jeff <britton.jeff@>
> > Subject: [flexcoders] Re: Using an ArrayCollection to populate a Tree 
> > component
> > To: flexcoders@yahoogroups.com
> > Date: Tuesday, April 6, 2010, 7:18 AM
> > 
> >      You can also create a custom data descriptor and set the 
> > dataDescriptor property of the tree component.  See http://livedocs. 
> > adobe.com/ flex/3/html/ help.html? content=about_ dataproviders_ 6.html 
> > <http://livedocs.adobe.com/flex/3/html/help.html?content=about_dataproviders_6.html>
> > 
> > --- In flexcod...@yahoogro ups.com 
> > </mc/compose?to=flexcoders%40yahoogroups.com> , Oleg Sivokon <olegsivokon@ 
> > ...> wrote:
> > >
> > > The best way would be to implement your own ICollectionView, however, this
> > > would be a complex task.
> > > For your example, I'd do it like so:
> > >
> > > private var ac:ArrayCollection = new ArrayCollection( [
> > >             { "Animals": ["dog", "cat"],
> > >             { "Fruits": ["orange", "apple"] }
> > >             ]);
> > >
> > >
> > > Best.
> > >
> > > Oleg
> > >
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > --
> > Alex Harui
> > Flex SDK Team
> > Adobe System, Inc.
> > http://blogs.adobe.com/aharui
> >
>


Reply via email to