One way to get the value you want displayed is with a cell
renderer. You can use a cell renderer by changing your
DataGridColumn to this:
<mx:DataGridColumn columnName="k" headerText="k l"
cellRenderer="MyCellRenderer"/>
Then create a file named MyCellRenderer.as and insert this:
import mx.controls.Label;
class MyCellRenderer extends Label {
function setValue(str:String, obj:Object, state:String) : Void {
if (obj != undefined) {
this.text = obj.k.l;
}
}
}
Note that this may not give you the desired effect when sorting the
grid by the "k l" column.
Doug
--- In [email protected], "deepu_verma" <[EMAIL PROTECTED]>
wrote:
>
> 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
<*> 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/