Dynamic Itemrenderer, reload when data changed

I had some troubles to re-load my itemrenderer. When the dataprovider of your collection (Tilebase or whatever) chage, the itemrenderer of exists items does not re-init, if your code is in creationComplete event. Finally I found a solution:in your itemrenderer file, on the creationComplete handler, add:

this.addEventListener(FlexEvent.DATA_CHANGE, dataChanged);dataChanged();

Then, in the dataChange function, you can do whatever you want for your itemrenderer when your dataprovider change.Hope this will help someone.


Posted by Alan Cheung  April 16th, 2008

3 Responses to “Dynamic Itemrenderer, reload when data changed”

  1. shi qiang Says:

    This is exactly what i m looking for!
    Thanks (from China)!

  2. CopyAndPaste Says:

    thanks dude… you have saved me some time…and workarounds… I hate crappy workarounds… ;)

  3. yacaFX Says:

    hey men u save me for losing te final soccer game1!!! thanks!!

Leave a Reply