Groups | Blog | Home
all groups > flash data integration > march 2005 >

flash data integration : Datagrid integration


vimrob
3/2/2005 4:35:18 AM
Hi all, I have an XML file & a datagrid instance on my stage.
Following is the code I am using to populate data into the grid: var
myXMLv:XML = new XML(); myXMLv.ignoreWhite=true; mydg.addColumn('Employee');
//mydg is the datagrid instance name mydg.addColumn('Extension');
myXMLv.onLoad = function(success:Boolean){ var xmlctr:Number; var
gridctr:Number; for(xmlctr =
0,gridctr=1;xmlctr<myXMLv.firstChild.childNodes.length,gridctr<(myXMLv.firstChil
d.childNodes.length-1);xmlctr++,gridctr++) { var myData =
{Employee:myXMLv.firstChild.childNodes[0].attributes.name,Extension:242};
mydg.addItemAt(gridctr, myData); } } myXMLv.load('data.xml'); Upon playing
the movie I get this error - 'Cannot add an item past the end of the
DataProvider'. Can anyone plz help me with this? Thanks, Robi
mjtanzer
4/12/2005 12:36:06 PM
Hi Rob,

First of all, you might want to clean up the code in your posting so it's
easier to read. Second, I don't see you setting the data provider in your code.
That could be the problem although it usually just fails quietly if you don't
set it.. I have just finished working on populating a datagrid component with
an xml file and I might be able to help you out if you can provide more info on
your code.

Mark
AddThis Social Bookmark Button