You can bind the result of your WebService to an ArrayCollection 
and then use it as the dataprovider for your Datagrid. Here is a 
simple of example of using an ArrayCollection as the datagrid 
dataprovider.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>

        <mx:Script>
                <![CDATA[
        
                        [Bindable]
                        public var myArray:Array = 
[{colA:'A',colB:'B'},{colA:'A1',colB:'This is a test'}];
                ]]>
        </mx:Script>

        <mx:DataGrid id="myGrid" dataProvider="{myArray}" 
width="100%" height="50%"
                 variableRowHeight="true" >
        <mx:columns>
            <mx:Array>
                <mx:DataGridColumn dataField="colA" 
headerText="Column A" width="70"/>
                <mx:DataGridColumn dataField="colB" 
headerText="Column B" width="50"/>
            </mx:Array>
        </mx:columns>
    </mx:DataGrid>
</mx:Application>

--- In flexcoders@yahoogroups.com, "plucka70" <[EMAIL PROTECTED]> wrote:
>
> I'm a real beginner, and know CF inside out. So I want to use Flex 
> 2. I've read a bit online and got a webservice call working 
> displaying the current time from a cfc.
> 
>  
> 
> Now I have a cfc generated using the wizard which is a database 
> related one, not sure what to do from here. I seems to generate an 
> array of objects, and each object defines a row in the table, this 
> all makes sense.
> 
>  
> 
> But how do get this into a flex data grid.
> 
>  
> 
> I assume I need to loop over the array and populate the data grid 
> using an Action Script function. Conceptually simple, but I'm 
hoping 
> people can explain the best way to do this and perhaps post a 
simple 
> sample that takes a table into a data grid.
> 
>  
> 
> PS: I'd rather not use the full generate wizards available, I'd 
> rather learn how to do it line by line on the Flex side.
> 
> Regards
> Dale Fraser
> 
> http://dale.fraser.id.au
>







--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to