The single instance of employee in the second version of the xml is not being treated as an array of employee objects.  You need to convert it to an array.
 
try changing your datagrid line to:
 
     <mx:DataGrid id="dg" dataProvider="{mx.utils.ArrayUtil.toArray(temp.employee}"/>
 

--
Ronald Kinion
253-205-3000 x5162
[EMAIL PROTECTED]


 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of flex scripter
Sent: Thursday, June 09, 2005 2:18 PM
To: [email protected]
Subject: [flexcoders] Doubt about XML and DataGrid

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="
http://www.macromedia.com/2003/mxml" >

<mx:Model id="temp" source="xml_src.xml"></mx:Model>
<mx:DataGrid id="dg" dataProvider="{ temp.employee}"/>
</mx:Application>

and in my XML file if I have

<employees>
<employee name ="Christina Coenraets" phone ="555-219-2270" email="
[EMAIL PROTECTED]" active="true"/>
<employee name ="Louis Freligh" phone="555-219-2100" email="
[EMAIL PROTECTED]" active="true"/>
</employees>

The data grid is populated. But if I have just

<employees>
<employee name ="Christina Coenraets" phone ="555-219-2270" email="
[EMAIL PROTECTED] " active="true"/>
</employees>

My data grid isnt getting populated.

What am I missing here ??

Thanks for your time and advice

Regards
Fx.


Yahoo! Groups Links

Reply via email to