Well a
little code example:
my
data grid:
<mx:DataGrid dataProvider="{my_data}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn
dataField="data_field1" itemRenderer="myItemRenderer"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
MyItemRenderer.mxml:
<mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"
xmlns="*">
<mx:Label text="{data.name}"
</mx:HBox>
This
does not work, the data.name does not exist and has to be:
"data.data_field1.name".
As you
can see that is not very "generic" if you have to set it for 30 columns
;)
-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED]On Behalf Of Webdevotion
Sent: donderdag 20 april 2006 15:43
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Custom itemrenderer in datagridHave you tried a for loop through the data object ?
What about data["column"].label notation ?
I'm at work now, can't test myself ...
On 4/20/06, B.Brey <[EMAIL PROTECTED]> wrote:That is just the thing, the DataGrid differs from a List.The "data" object your receive in an itemrenderer for a DataGrid contains data of the whole row.I just want the cell data.-----Original Message-----
From: flexcoders@yahoogroups.com [mailto:flexcoders@yahoogroups.com]On Behalf Of Webdevotion
Sent: donderdag 20 april 2006 14:34
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Custom itemrenderer in datagridDoes this clear things out for you ?
I guess just use {data.property}.
Check out this article
snip:
<mx:itemRenderer>
<mx:Component>
<mx:Canvas>
<mx:CheckBox id="complete" width="20" x="10" y="4" selected= "{data.selected}"/>
<mx:Text id="taskname" text="{data.label}" />
</mx:Canvas>
</mx:Component>
</mx:itemRenderer>--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comSPONSORED LINKS
Web site design development Computer software development Software design and development Macromedia flex Software development best practice
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
--
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
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.