This worked for me .....using Label Function

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml";
initialize="myInit()">

<mx:Script>
<![CDATA[
var arr:Array;
public function myInit()
{
arr = new Array()
arr[0] = new Object()
arr[0].j=10;
arr[0].k=new Object()
arr[0].k.l=20;

}

function getK(oItem:Object)
{
 return oItem.k.l;
}
]]>
</mx:Script>



<mx:DataGrid dataProvider="{arr}" >
                         <mx:columns>
                                     <mx:Array>
               <mx:DataGridColumn columnName="j" headerText="j" />
                                        <mx:DataGridColumn columnName="k.l"
headerText="k l" labelFunction="getK" />
            </mx:Array>
                         </mx:columns>
             </mx:DataGrid>
</mx:Application>


|---------+----------------------------->
|         |                             |
|         |  "deepu_verma"              |
|         |  <[EMAIL PROTECTED]>    |
|         |  Sent by:                   |
|         |  [email protected] |
|         |  02/09/2006 05:32 PM        |
|         |  Please respond to          |
|         |  flexcoders                 |
|         |                             |
|---------+----------------------------->
  
>-----------------------------------------------------------------------------------------------------------------------------|
  |                                                                             
                                                |
  |      To: [email protected]                                         
                                                |
  |      cc:                                                                    
                                                |
  |      Subject:  [flexcoders] populate datagrid from object of object         
                                                |
  
>-----------------------------------------------------------------------------------------------------------------------------|




Hi,
I am trying to populate a datagrid from object object as in the below
example  (this is a dummy example, i am getting the result from a VO)

var arr = new Array()
arr[0] = new Object()
arr[0].j=10;
arr[0].k=new Object()
arr[0].k.l=20;

<mx:DataGrid dataProvider="{arr}" >
                         <mx:columns>
                                     <mx:Array>
               <mx:DataGridColumn columnName="j" headerText="j" />
                                        <mx:DataGridColumn columnName="k.l"
headerText="k l" />
            </mx:Array>
                         </mx:columns>
             </mx:DataGrid>

The second column is not displayed (k.l is not picked by the data grid)





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




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