I suggest reading this post
<http://blogs.adobe.com/aharui/2007/03/thinking_about_item_renderers_1.html>
on Alex Harui's blog. He describes the use of item renderers very
well. You can also find information on the "working with item
renderers" page of the live docs
<http://livedocs.adobe.com/flex/3/html/help.html?content=cellrenderer_8.html>.
This post <http://blog.fastlanesw.com/?p=25> on my blog also shows the
use of a custom item renderer that overrides the data property setter in
order to set the background color of a data grid cell. Just click the
link for the sample app, then right click on the app to view source.
hth
Scott
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com
Alexander Tsoukias wrote:
Thank you so much for this info, can you possibly give me a code
example scenario?
thanks
alexander
--- In [email protected], Scott Melby <[EMAIL PROTECTED]> wrote:
Alexander -
Flex recycles itemRenderers, so it does not create 1 per item in your
data provider. Instead it creates enough renderer objects to display
the data, then calls the setter of the data property "set
data(value:Object)" on those existing renderers as things change
(scroll, etc.) So, the way you handle this is to override the set
data(value:Object) method in your renderer... the object you are passed
as a parameter will be an item from your data provider.
hth
Scott
Scott Melby
Founder, Fast Lane Software LLC
http://www.fastlanesw.com
http://blog.fastlanesw.com
Alexander Tsoukias wrote:
I am using an itemRenderer and in that renderer i am calling the
init() method on creationComplete event.
The List's dataprovider is an ArrayCollection from LCDS rtmp and i
notice that the init() function does not get called everytime a new
item is added (even though the new item does display on the TileList
as a new row.
So I guess my question is, how can i EVERYTIME call a function in my
itemRenderer component?
thanks,
Alexander