[flexcoders] Help on DataGrid dataProvider

2009-03-04 Thread jcjr031064
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



RE: [flexcoders] Help on DataGrid dataProvider

2009-03-04 Thread Alex Harui
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:flexcod...@yahoogroups.com] On Behalf 
Of jcjr031064
Sent: Tuesday, March 03, 2009 11:43 PM
To: flexcoders@yahoogroups.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