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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
where does the data in the datagrid come from?
ASKER
It will be added at this way:
var anObject = {Pos:"", Article:Art, Quantity:"1"};
var addedObject = _root.cList.addItem(anObje ct);
var anObject = {Pos:"", Article:Art, Quantity:"1"};
var addedObject = _root.cList.addItem(anObje
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
GE
ASKER
var anObject = {Pos:"", Article:Art, Quantity:"1"};
is inserted from other input boxes, there's no external data loaded
is inserted from other input boxes, there's no external data loaded
ASKER
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