Hi Tom,

I'm not sure this will help, but ... first, you're setting the GroupingField
name attribute to the PService object in your array collection, which is
itself an array collection.

<mx:Grouping> <mx:GroupingField name="PService"/> </mx:Grouping>
[Bindable]
private var pArr3:ArrayCollection = new ArrayCollection([
{*pid:"4503599627371607*", psName:"Sub2BusinessView" }
]);

I have no idea why you're creating the value of your PService an array
collection. Perhaps there's a reason. But I'm not sure that you can even set
a GroupingField to an array (the docs don't mention it). And even if you
could, you'd have to have a function somewhere that evaluated the array to
give the GroupingField something to use.

Basically, the GroupingField wants the name of a property in your array
collection/dataset that contains a simple value(ParentID=1, or
Parent="marge" or whatever).

The easiest way to deal with a situation such as yours is to manipulate the
dataset in advance. When I do this sort of Parent/Child thing, I will
typically write my query to create a "Parent" field. This field contains the
name of the Parent for each Child entry. And there are no entries at all for
the Parent entity itself. Then I simply make Parent a GroupingField.

That will give the top-level "folder" item the name of the Parent, and items
within will be the children.

Your situation seems a little different, in that you want to show several
attributes of the parent, too. In your case, I'd suggest including the
Parent entity along with its children (essentially, its Parent field would
have the same value as its own name).

A grouping row is not made to display the same pieces of information as the
"item" rows. So you find various ways to work around this.

I think if you try this general approach, it will make things simpler. If
you do not have control of the data coming from the server, then you'd just
create a function that loops over the incoming data and creates an array
with the values you need,

The docs on using the ADG have examples that are essentially Parent/Child
relationships. They may be helpful.

-- 
Thanks,

Tom

Tom McNeer
MediumCool
http://www.mediumcool.com
1735 Johnson Road NE
Atlanta, GA 30306
404.589.0560

Reply via email to