I would programmatically manipulate the xml, probably building a new XML structure to be the dataProvider.
Tracy ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Alain Thibodeau Sent: Wednesday, March 28, 2007 8:31 PM To: [email protected] Subject: Re: [flexcoders] HTTPService/ArrayCollection/DataGrid/Tree/ Hi Tracy, Thanks for taking the time..Given that xml I would like the tree to look like this: >Chicago >Name >New York >Name >Miami >Name Basically, extract from the xml, the "area" as a branch and put the "name" as its leaf...However, there can be more than one "item" in the xml with the same "area", those should be all put under the same "area" branch...for example Chicago can have more than one leaf coming from more than one "item".. hope it makes sense.. I think I will need to write a custom data class...? Thanks again for your time, very much appreciated. ----- Original Message ---- From: Tracy Spratt <[EMAIL PROTECTED]> To: [email protected] Sent: Wednesday, March 28, 2007 6:30:10 PM Subject: RE: [flexcoders] HTTPService/ArrayCollection/DataGrid/Tree/ So given that xml, what do you want your tree to look like? Tracy ________________________________ From: [EMAIL PROTECTED] ups.com [mailto: [EMAIL PROTECTED] ups.com ] On Behalf Of Alain Thibodeau Sent: Wednesday, March 28, 2007 8:12 AM To: [EMAIL PROTECTED] ups.com Subject: [flexcoders] HTTPService/ ArrayCollection/ DataGrid/ Tree/ Hi all, I was wondering if someone could please point me in the correct direction. I have an HTTPService that I am using with a datagrid, the Service's data is loaded into an ArrayCollection and I filter the ArrayCollection with a filterFunction. All works great. I now want to take the same ArrayCollection and load certain elements of the data into a tree. This is where I am getting errors. The xml: <?xml version="1.0" encoding="utf- 8"?> <build> <item id="1"> <name>Name</name> <area> Chicago </area> <status>Avail.</status> <spec>1264</spec> <size>40</size> </item> <item id="2"> <name>Name</name> <area> New York </area> <status>Avail.</status> <spec>1264</spec> <size>49</size> </item> </build> I want to display in the tree the area(s) as the folder and the name under it as a leaf(s). All I managed to do is a labelFunction that returns the area, and populates the tree as leafs. I am assuming, I will have to create a custom function? private function trModels(item: Object):String{ return item.community; } Now all the docs I could find tell me to use the result on the httpservice as e4x and filter the data that way for the tree, but when I specify e4x as resultFormat I get an error and it breaks my filtering on the datagrid...: Error #1034: Type Coercion failed: cannot convert [EMAIL PROTECTED] to mx.collections. ArrayCollection. Can anyone point me in the correct direction please? There must be a way to filter data that is not "tree" friendly.. thank-you ________________________________ Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. <http://ca.answers.yahoo.com/> ________________________________ All new Yahoo! Mail - <http://us.rd.yahoo.com/evt=40705/*http:/mrd.mail.yahoo.com/try_beta?.in tl=ca> ________________________________ Get a sneak peak at messages with a handy reading pane.

