1 Reply Latest reply on Feb 27, 2010 4:35 PM by cheftimo

    AdvancedDataGrid – prevent itemRenderer from displaying on certain rows

    cheftimo Level 2

      I have an ADG displaying products, with grouping fields, the dataProvider being an ArrayCollection, a flat structure.

       

      One of the columns uses an itemRenderer to display a thumbnail image. On the rows that show a folder icon, the itemRenderer displays a broken image icon, since those rows have no data.

       

      I would like the folder icon rows to not display the itemRenderer. I have tried writing a function to make the renderer invisible on those rows:

       

      private function thumbVisible():Boolean{

      if (data.Thumbnail == null){return false}

      else {return true};

       

      I have tried the above and several variations of it to set the visible property of the thumbnail image, with no success.

       

      If you want to see exactly what the issue is, browse to http://www.webgourmand.com/wg/CyberCucina/CyberCucina.html and go to the tab labeled "Beverages, other".

       

      I would really appreciate any ideas about this – and comments about any other issues you may notice if you look at the project - this is still a work-in-progress.

       

      Best regards,

       

      Carlos

        • 1. Re: AdvancedDataGrid – prevent itemRenderer from displaying on certain rows
          cheftimo Level 2

          I figured it out:

           

          I added a parameter to the function shown in the previous post. Now it is

           

          private function thumbVisible(ob:Object):Boolean{

          if (ob.Thumbnail == null){return false}

          else {return true};

           

          Then in the image tag of the renderer, instead of

          visible = "{thumbVisible()}"

          now it is

          visible = "thumbVisible(data)"

           

          I have no idea why this works and the previous one does not, but if anyone cares to explain, I would love to hear.

           

          If have not re-uploaded, so it you browse to http://www.webgourmand.com/wg/CyberCucina/CyberCucina.html and go to the tab labeled "Beverages, other", you will still see the problem. I will be re-uploading in the next day or two.

           

          I would still appreciate any comments about any other issues you may notice if you look at the project.

           

          Greetings,

           

          Carlos