import mx.controls.gridclasses.DataGridColumn;
var colNamevar1:DataGridColumn = item_dg.addColumn(new
DataGridColumn("colNamevar1"));
colNamevar1.headerText = "Name:";

item_dg.addItem({colNamevar1:dynVal1, colNamevar2:dynVal2,
colNamevar3:dynVal3});                                  

Inside of a while loop should be sufficient -- as long as the var names
you use to assign the column Headers is identical to the addItem code...


Below is a snippet of how we fill dg's with dynamic XML...

while (theXML.firstChild.firstChild.hasChildNodes()){   
        x++;
        var z = theXML.firstChild.firstChild;
        for (var i = 0; i<z.childNodes.length; i++) {
                //trace("\t"+z.childNodes[i].firstChild.nodeValue)
                dsArray.splice(i, 0,
z.childNodes[i].firstChild.nodeValue)
        }
        item_dg.addItem({consignQty:dsArray[0], ownedQty:dsArray[1],
ID:dsArray[2]});                                        
        dsArray.splice(0,50);
        theXML.firstChild.firstChild.removeNode();


HTH...


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: Wednesday, May 10, 2006 1:51 PM
To: flashcoders@chattyfig.figleaf.com
Subject: RE: [Flashcoders] dynamic creation of a datagrid

I use a perl script that give me a big string with | as row delimiter
and # as cell delimiter.
I'm able to spit it by rows and split every row .
I also have another string with all headers.

I'm able to add headers but i don't know how to add data...
_______________________________________________
Flashcoders@chattyfig.figleaf.com
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


_______________________________________________
Flashcoders@chattyfig.figleaf.com
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

Reply via email to