1 Reply Latest reply on Sep 15, 2009 12:51 PM by _Natasha_

    Problem with icon for an itemRendrer when scroll




      I hav a data grid with three columns. In the first column I have to display an icon and a text in front of it.

      For this I do an item rendrer containing the following :


      <mx: Image id ="myIcon">

      <mx: Text  text={data.label} />



      The problem is when I scroll down the datagrid the itemRendrers are recycled and icons are not conserving their order.


      Any idea ?

        • 1. Re: Problem with icon for an itemRendrer when scroll
          _Natasha_ Level 4



          if you have wrong order, this means that


          there is a error in your realization


          there is a misunderstanding of concept itemRenderer.


          There are two important thing:

          - all images and text should be based on data (properties, attributes and other)! Not any order.

          - when data for itemRenderer changed, always called public function set data(value:Object):void. So you MUST override it tot change icons, labels and others.