if you know the name of the child you want to loop over you can access
it like dataprovider="{myXmlListCollection.myChildElement}"

 

otherwise, you can usually use something like
dataprovider="{dg2data.getChildern()}" which returns an XMLList

 

 

brian..

 

 

 

 

 

 

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of its_llpj
Sent: Thursday, September 06, 2007 10:13 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Populating XMLListCollection and sending it to a
Datagrid

 

Hello, I'm trying to populate a datagrid. Here is my code. Everything
works, but when I use the dataProvider dg2data within my datagrid it
comes back empty. I know there is data there, but not sure if I'm
missing something.

public function onSelectFirstGrid(event:Event):void

{
myRequest.addEventListener(Event.COMPLETE, onResult)
myRequest.send(dg.selectedItem.myID);
}

private function onResult(e:ResultEvent):void

{
dg2data = e.result as XMLListCollection;
}

private function onFault(e:FaultEvent):void

{
Alert.show(e.fault.message, "Could not load");
}

[Bindable]
public var dg2data: XMLListCollection;

My DataGrid
<mx:DataGrid id="dg2" width="100%" height="100%" rowCount="10"
dataProvider="{dg2data}">
<mx:columns>
<mx:DataGridColumn dataField="name" headerText="Name" />
</mx:columns>
</mx:DataGrid>

Thanks! 

 



***
The information in this e-mail is confidential and intended solely for the 
individual or entity to whom it is addressed.  If you have received this e-mail 
in error please notify the sender by return e-mail delete this e-mail and 
refrain from any disclosure or action based on the information.
***

Reply via email to