Link to home
Start Free TrialLog in
Avatar of andre72
andre72

asked on

Read data from DataGrid with ActionScript 2

Hi,

I'm a novice with Flash and have to modify an application.
There's a datagrid within this app and I need the data from.
So at the screen the datagrid, called cList and have this code:
cList.columnNames = ["Pos","Article","Quantity"];

dbList = new Array();
cList.dataProvider = dbList;

I tried this with by button but it's always empty:
on(click){
      trace(_root.dbList.length);
      for(var i in _root.dbList) {
      var value = _root.dbList.getItemAt(i - 1).Article;
      trace(value);
      }
}

Can somebody show me the right way please?

Thanks,

Andre
ASKER CERTIFIED SOLUTION
Avatar of Eaddy Barnes
Eaddy Barnes
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of andre72
andre72

ASKER

Hi,

thanks for the link but there's only explained how to add items and to sort them.
I need hints how to read the added items...

Andre
where does the data in the datagrid come from?
Avatar of andre72

ASKER

It will be added at this way:
var anObject = {Pos:"", Article:Art, Quantity:"1"};
var addedObject = _root.cList.addItem(anObject);
does the data that is loaded into the datagrid not come from a variable of an external data file such as xml   or perhaps both?

GE
Avatar of andre72

ASKER

var anObject = {Pos:"", Article:Art, Quantity:"1"};
is inserted from other input boxes, there's no external data loaded