loki421
03-23-2010, 02:46 AM
Hi everyone!
Ok, so i've listed a directory with ColdFusion using:
<cffunction name="getServerData" access="remote" returntype="any" >
<cfdirectory name="dir" directory="#ExpandPath('../my folder/')#" action="list" >
<cfreturn dir>
</cffunction>
And have passed it back to Flex like so:
private function rh(event:ResultEvent):void{
directoryData = event.result as ArrayCollection;
}
And this works lovely :) But i cannot access the data, like the name, size, type etc using a datagrid like so:
<mx:DataGrid x="26" y="38" id="adg1" dataProvider="{directoryData}" width="374" height="165">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="File Size" dataField="size"/>
<mx:DataGridColumn headerText="Type" dataField="TYPE"/>
</mx:columns>
</mx:DataGrid>
I have read somewhere that using capitals in the dataField will return the data, but as you can see from the code i have tried this in the 'type' field.
Anyone out there have any ideas on why i'm only seeing [object, object]?????
Many thanks in advance! :D
Ok, so i've listed a directory with ColdFusion using:
<cffunction name="getServerData" access="remote" returntype="any" >
<cfdirectory name="dir" directory="#ExpandPath('../my folder/')#" action="list" >
<cfreturn dir>
</cffunction>
And have passed it back to Flex like so:
private function rh(event:ResultEvent):void{
directoryData = event.result as ArrayCollection;
}
And this works lovely :) But i cannot access the data, like the name, size, type etc using a datagrid like so:
<mx:DataGrid x="26" y="38" id="adg1" dataProvider="{directoryData}" width="374" height="165">
<mx:columns>
<mx:DataGridColumn headerText="Name" dataField="name"/>
<mx:DataGridColumn headerText="File Size" dataField="size"/>
<mx:DataGridColumn headerText="Type" dataField="TYPE"/>
</mx:columns>
</mx:DataGrid>
I have read somewhere that using capitals in the dataField will return the data, but as you can see from the code i have tried this in the 'type' field.
Anyone out there have any ideas on why i'm only seeing [object, object]?????
Many thanks in advance! :D