Basically i want to use an array preferably an array collection to be
a
dataprovider for a grid. I know before flex 2 you use to be able to
use
dataprovider.additem, however now I cannot seem to do that.
What i have
now that currently shows just blank for it is :
var
fcAll:ArrayCollection=new ArrayCollection();
var fcName_:Array =
new Array();
var fcDate_:Array = new Array();
var fcCount_:Array = new
Array();
fcAll =
httpFC_Report.lastResult.sql_results.result_set.rows.row;
var
fcNameOut_:Array = new Array();
var fcDateOut_:Array = new Array();
var
fcCountOut_:Array = new Array();
for (var i:int=0;
i<fcAll.length; i++) {
var seq:int = 0;
fcDate_[i] =
fcAll[i].value1.toString();// col_name
fcName_[i] =
fcAll[i].value2.toString();// fld_name
fcCount_[i] =
fcAll[i].value3.toString();// col_type
fcDateOut_[i] =
fcDate_[i];// col_name
fcCountOut_[i]=
fcCount_[i];
fcNameOut_[i]=fcAll[i].value2.toString();
}
for(i=0;
n< fcName_.length; n++){
grid.dataProvider ({name:fcName_[n],
date:fcDate_[n], count:fcCount_[n]});
}
and my xml for the
datagrid is
<mx:DataGrid x="51" y="98" width="562.5" height="253"
id="reportGrid">
<!--
dataProvider="{httpFC_Report.lastResult.sql_results.result_set.rows.row}"
-->
<mx:columns>
<mx:DataGridColumn
headerText="Filecabinet Name"
width="250"
dataField="name"/>
<mx:DataGridColumn
headerText="Date" width="100"
dataField="date"/>
<mx:DataGridColumn headerText="Count"
dataField="count"/>
</mx:columns>
</mx:DataGrid>
Any
help you could provide would be greatly appreciated, tia
Also something like
what i want to do is here
http://groups.yahoo.com/group/flexcoders/message/42568
Sincerely,
Ben