-
Populate a datagrid from an internal array
Hi. Is it possible to populate the datagrid from an internal array, rather than an external xml file?
M@)
-
Flashmatics
suppose your datagrid component has instance name "empData" then use the following to populate it:
Code:
var aEmployees:Array = new Array(
{Name:"John", Job:"Director", Salary:"21000"},
{Name:"Alex", Job:"Clerk", Salary:"43000"},
{Name:"Nathan", Job:"Manager", Salary:"84000"}
);
empData.dataProvider = aEmployees;
-
Im using flash pro 8 - where can I download a data grid component? Can you send me an example? M@)
-
Flashmatics
Look in your components panel and the in UI Components..should be there...(at least for mx 2004)
-
-
Can a data grid component be efficiently connected to a text file for population?
-
I seem to have some similar problems populating my datafield.
//I use ->MDM Zinc the mdm.Database.MSAccess are extras thus.
PHP Code:
_root.mdm.Database.MSAccess.select("SELECT * FROM inv_list WHERE order_status='New Request'");
var maq = _root.mdm.Database.MSAccess.getRecordCount();
var dataSet = mdm.Database.MSAccess.getData();
mdm.Dialogs.prompt(maq)
var chicken:Array = new Array();
for (i=0;i<maq;i++){ //dataSet[row][column] how its read.
chem = dataSet[i][1];
supp = dataSet[i][8];
catn = dataSet[i][9];
odat = dataSet[i][11];
osta = dataSet[i][10];
chicken.push({chemical:chem, supplier:supp, catalogue_number:catn, order_date:odat, order_status:osta});
//mdm.Dialogs.prompt(chicken.length)
//mdm.Dialogs.prompt(chicken)
}
AAmount = maq;
for (q=0; q<AAmount; q++){
var aj = chicken[q] ;
var whats = aj.chemical;
var whats1 = aj.supplier;
var whats2 = aj.catalogue_number;
var whats3 = aj.order_date;
var whats4 = aj.order_status;
mdm.Dialogs.prompt(whats+","+whats1+","+whats2+","+whats3+","+whats4)
//the above prompts the info in the array correct, its there!
}
myDPF.dataProvider = chicken; //gives me the right headertext but no data.
Why is there no data? your time and effort is appreaciated!!
*Using Flash 8.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|