Try casting the result to an Array ...

      myArray= mx.utils.ArrayUtil.toArray(event.result);

It worked for me in a similar case ...





                                                                                
                                            
                                                                                
                                            
             "Parekh, Shweta - BLS CTR"        To: 
"'flexcoders@yahoogroups.com'" <flexcoders@yahoogroups.com>              
             <[EMAIL PROTECTED]>           cc:                                  
                                        
             Sent by:                          Subject:  [flexcoders] 
Populating values in datagrid from arrays             
             flexcoders@yahoogroups.com                                         
                                            
             10/03/2005 02:19 PM                                                
                                            
             Please respond to                                                  
                                            
             flexcoders                                                         
                                            
                                                                                
                                            
                                                                                
                                            




Hi,

I am having problem populating values in my datagrid. From my mxml, I make
a
remote call to my controller which returns an array of ItemVOs.
ItemVO has one-dimensional integer array, containing values for columns in
each row in the datagrid. i.e. if my int array in ItemVO1 contains values
1,
2 and array in ItemVO2 contains values 3,4, then my datagrid should display

   1    2
   3    4
Instead the code below displays my datagrid as
  1,2   1,2
  3,4   3,4

Code:
<mx:RemoteObject id="itemDetailController"
source="controllers.ItemDetailController" showBusyCursor="true">
             <mx:method name="getColSpecData"
result="result_ColSpecData=event.result">
                                     <mx:arguments>
                         <arg1>{itemSid}</arg1>
                                     <arg2>{irMonth}</arg2>
                                     <arg3>{monthNo}</arg3>
                         </mx:arguments>
             </mx:method>
</mx:RemoteObject>
<mx:VBox>
               <mx:DataGrid id="colSpec_dg" width="600"
dataProvider="{result_ColSpecData}" textAlign="left" height="250"
headerHeight="50" editable="true" >
                 <mx:columns>
                           <mx:Array>
                             <mx:DataGridColumn headerText="A"
columnName="colSpecData" width="50" textAlign="left"/>
                             <mx:DataGridColumn headerText="B"
columnName="colSpecData" width="100" textAlign="left"/>
                           </mx:Array>
                 </mx:columns>
               </mx:DataGrid>

<mx:FormItem direction="horizontal" width="100%" height="30">
             <mx:Text text="value:" width="90"/><mx:Spacer height="63"/>
             <mx:Text id="tobEffIrm"
text="{itemDetailController.getColSpecData.result[0].colSpecData[0]}"
width="57"/><mx:Spacer height="63"/>
             <mx:Text id="tobEffIrm1"
text="{itemDetailController.getColSpecData.result[0].colSpecData[1]}"
width="57"/><mx:Spacer height="63"/>
             <mx:Text id="tobEffIrm2"
text="{itemDetailController.getColSpecData.result[1].colSpecData[0]}"
width="57"/><mx:Spacer height="63"/>
             <mx:Text id="tobEffIrm3"
text="{itemDetailController.getColSpecData.result[1].colSpecData[1]}"
width="57"/><mx:Spacer height="63"/>
</mx:FormItem>

If I replace colSpecData with colSpecData[0] and colSpecData[1], datagrid
does not show any values. But the text field displays values fine as 1 2 3
4.
I fail to understand why the dataprovider in the datagrid does not work
with
indexes specified. Can anybody please help me with this.

Thanks in advance,
Shweta





--
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











---------------------------------------------------------------------------
This e-mail message (including attachments, if any) is intended for the use
of the individual or entity to which it is addressed and may contain
information that is privileged, proprietary , confidential and exempt from
disclosure.  If you are not the intended recipient, you are notified that
any dissemination, distribution or copying of this communication is
strictly prohibited.  If you have received this communication in error,
please notify the sender and erase this e-mail message immediately.
---------------------------------------------------------------------------




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Fair play? Video games influencing politics. Click and talk back!
http://us.click.yahoo.com/T8sf5C/tzNLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~-> 

--
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