Flex will find the attributes but not the child nodes. Alex Harui Flex SDK Developer Adobe Systems Inc.<http://www.adobe.com/> Blog: http://blogs.adobe.com/aharui
From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of jcjr031064 Sent: Wednesday, March 04, 2009 7:56 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Help on DataGrid dataProvider Thanks a lot. I followed your recommendation and it worked. I though that flex automatically fetched the field names from the xml as in the case of default resultFormat i.e. object. I guess for e4x, the dataGridColums must be explicitly specified. Thanks again. JC --- In flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>, Alex Harui <aha...@...> wrote: > > You may need to specify the dataFields in your DataGridColumns depending on > what the XML really looks like > > Alex Harui > Flex SDK Developer > Adobe Systems Inc.<http://www.adobe.com/> > Blog: http://blogs.adobe.com/aharui > > From: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > [mailto:flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com>] On > Behalf Of jcjr031064 > Sent: Tuesday, March 03, 2009 11:43 PM > To: flexcoders@yahoogroups.com<mailto:flexcoders%40yahoogroups.com> > Subject: [flexcoders] Help on DataGrid dataProvider > > > Hello guys, > A newbie here. > > I have this code: > <?xml version="1.0" encoding="UTF-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" > layout="absolute" creationComplete="bookData.send()"> > > <mx:Script> > <![CDATA[ > import mx.rpc.events.ResultEvent; > import mx.rpc.events.FaultEvent; > import mx.controls.Alert; > > [Bindable] > private var bookInfo:XMLList; > > private function handleXML(event:ResultEvent):void{ > bookInfo=event.result.stock as XMLList; > Alert.show(xmlBooks.toString()); > Alert.show(bookInfo); > } > ]]> > </mx:Script> > <mx:XMLListCollection id="xmlBooks" > source="{bookData.lastResult.stock}"/> > <mx:HTTPService result="handleXML(event)" id="bookData" url="books.xml" > resultFormat="e4x"/> > <mx:DataGrid x="56" y="250" width="950" > dataProvider="{xmlBooks}"/> > </mx:Application> > > How do I get the datagrid to be populated with rows? The alert.show calls > somehow get the data. > > What am i missing here? > > JC >