Hi!
I have an xml structure, that i want to list into an data grid
component. I want to use dataProvider for that so i proceed like this:
var my_data:Array = new Array();
for (var aNode:XMLNode = my_xml.firstChild.firstChild; aNode != null;
aNode=aNode.nextSibling) {
if (aNode.nodeType == 1) {
var obj = new Object();
for (var attr in aNode.attributes) {
obj[attr] = aNode.attributes[attr];
}
my_data.addItem(obj);
}
}
//my_dg is instance name for data grid component
my_dg.dataProvider = my_data;
Problem is that, columns are displayed in reverse order than is in
my_xml. How i can resolve that?
For example:
var xml_str = "<datapacket><row name="John" password="123" /></datapacket>";
var my_xml:XML = new XML(xml_str);
wil display first column password and then name.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com