First don't use mx:Model.  That converts your XML into a nested object
structure.  Use mx:XML instead, and see how that changes things.

 

If this is still an issue, you might need to use a labelFunction, but I
doubt it.

 

Tracy

 

________________________________

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of kalpkat9
Sent: Saturday, November 03, 2007 7:16 PM
To: [email protected]
Subject: [flexcoders] Datagrid ArrayCollection XML Data - unwanted text,

 

Hi,

I am parsing data from an xml file(sheet11.xml) into an 
ArrayCollection, and some of the fields in the xml files has no data,
such as <field2>:

sheet11.xml
<row>
<field1>data1</field1>
<field2></field2>
<field3>data1</field3>
</row>

when i populate the data into my datagrid and execute the mxml, i 
have the field2 column filled with '[object object]' rather than 
being blank. How is that I can make the field showing no text if 
there no data coming from the xml. can someone please help me on 
this. thank you.

import mx.utils.ArrayUtil;

<mx:Model id="dataXML" source="sheet11.xml"/> 
<mx:ArrayCollection source="{ArrayUtil.toArray(dataXML.row)}" 
id="theData"/>

<mx:DataGrid id="dg" allowMultipleSelection="true" 
dataProvider="{theData}">
<mx:columns>
<mx:DataGridColumn dataField="field1"/>
<mx:DataGridColumn dataField="field1"/>
<mx:DataGridColumn dataField="field1"/>
</mx:columns>
</mx:DataGrid>

 

Reply via email to