<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml">
<mx:Model id="testModel">
<user>
<name>Maegerman</name>
<firstName>Philippe</firstName>
</user>
<user>
<name>My name</name>
<firstName>is nobody</firstName>
</user>
</mx:Model>
<mx:DataGrid id="dg" dataProvider="{testModel.user}">
<mx:columns>
<mx:Array>
<mx:DataGridColumn headerText="Name" columnName="name" />
<mx:DataGridColumn headerText="First name" columnName="firstName"/>
</mx:Array>
</mx:columns>
</mx:DataGrid>
<mx:Button label="italicRenderer" click="dg.getColumnAt(1).cellRenderer = 'italicRenderer'; dg.dataProvider = dg.dataProvider; dg.redraw();"></mx:Button>
<mx:Label xmlns:mx="http://www.macromedia.com/2003/mxml" fontWeight="bold">
<mx:Script>
<![CDATA[
function setValue(str:String, item:Object, sel:Boolean){
text = item.firstName;
}
]]>
</mx:Script>
</mx:Label>
<mx:Label xmlns:mx="http://www.macromedia.com/2003/mxml" fontStyle="italic">
<mx:Script>
<![CDATA[
function setValue(str:String, item:Object, sel:Boolean){
text = item.firstName;
}
]]>
</mx:Script>
</mx:Label>
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Manish Jethani
Sent: jeudi 8 septembre 2005 9:31
To: [email protected]
Subject: Re: [flexcoders] cellRenderer
> If I would ask my question differently it would be :
> Is it possible to change cellRenderers on the fly, switching from
> cellRendererA to cellRendererB ?
I think changing the cell renderer that way should work - i.e it
should refresh the DataGrid with the new cells. I haven't tried. If
it doesn't work, you could try refreshing the grid by reassigning the
dataProvider
grid.dataProvider = grid.dataProvider
--
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.
------------------------------------------------------------------
**STATEMENT OF CONFIDENTIALITY**
This e-mail and any attached files are confidential and intended solely for the use of the individual to whom it is addressed. If you have received this email in error please send it back to the person that sent it to you. Any views or opinions presented are solely those of author and do not necessarily represent those the Emakina Company. Unauthorized publication, use, dissemination, forwarding, printing or copying of this email and its associated attachments is strictly prohibited.
We also inform you that we have checked that this message does not contain any virus but we decline any responsability in case of any damage caused by an a non detected virus.
------------------------------------------------------------------
boldRenderer.mxml
Description: boldRenderer.mxml
dGridCellRenderer.mxml
Description: dGridCellRenderer.mxml
italicRenderer.mxml
Description: italicRenderer.mxml

