Hi,
This may be a newbie question, but here goes:
My XML is something like this:
Now the question is, how can I make a datagrid with all the info and name, phone1, phone2 and phone3 as columns?
Now I have something like this is flex:
The problem is obviously the multiple phones... I've tried putting {phones.phone} in the dataField and other tests, but no result... On the 2 lasts columns, the dataProvider should be {mydata..person..phone} I think, but how do I do this? (Can't change the xml)
Any suggestions? How can you modify the dataField to skip an other child in the XML?
Thanks in advance !
This may be a newbie question, but here goes:
My XML is something like this:
Code:
<persons>
<person>
<name>XXX</name>
<phones>
<phone>yyy</phone>
<phone>zzz</phone>
</phones>
</person>
<person>
...
</person>
</persons>
Now I have something like this is flex:
Code:
<mx:XML id="mydata" source="[URL unfurl="true"]http://localhost/retrievePersons.php"></mx:XML>[/URL]
<mx:TabNavigator x="20" y="20" width="700" height="300">
<mx:Canvas label="Persons" width="700" height="250">
<mx:DataGrid x="10" y="10" width="240" dataProvider="{mydata..person}">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name" width="160"/>
<mx:DataGridColumn headerText="Phone1" [b]dataField="phone"[/b] width="40"/>
<mx:DataGridColumn headerText="Phone2" [b]dataField="phone"[/b] width="40"/>
</mx:columns>
</mx:DataGrid>
</mx:Canvas>
Any suggestions? How can you modify the dataField to skip an other child in the XML?
Thanks in advance !