2 Replies Latest reply on Jun 28, 2007 9:40 PM by SunnyCloud777

    Weird behaviors of Image in DataGrid itemRenderer

      In this test program, I just can't control the visibility of the <image> inside the DataGrid renderer. Also, its size is weird, too. The independent <image> displays the original image and can control the visibility. Why??? Thanks in advance, - James

      <?xml version="1.0">
      <mx:Application xmlns=" http://www.adobe.com/2006/mxml">
      import mx.collections.ArrayCollection;
      private var attrs:ArrayCollection = new ArrayCollection( [ 0 ] );

      <Image visible="false" source="@Embed('../dirty.png')"/>

      <DataGrid width="100%" top="10" height="100%" dataProvider="{attrs}">
      <DataGridColumn headerText="" dataField="dirty">
      <mx:Image visible="true" source="@Embed('../dirty.png')"/>

        • 1. Re: Weird behaviors of Image in DataGrid itemRenderer
          leotemp Level 1
          What do you mean you cant control visibilty? do you mean the image set to false is visible or the image set to visible="true" isnt visible or both? If you are trying to change the visiblity from a function make sure to set object.visible= true; not "true"
          • 2. Re: Weird behaviors of Image in DataGrid itemRenderer
            I have the same problem. Image inside the itemRenderer is always visible regardless the attribute.

            <mx:Image source="@Embed(source='/pics/ft_demo.gif')" visible="false"
            click="navigateToURL(new URLRequest(data.demo_url), '_blank')"/>
            <mx:DataGrid id="dg" width="100%" height="100%" rowCount="5" dataProvider="{fl}">
            <mx:DataGridColumn dataField="demo" headerText="Demo">
            <mx:Image source="@Embed(source='/pics/ft_demo.gif')" visible="false"
            click="navigateToURL(new URLRequest(data.demo_url), '_blank')"
            toolTip="{data.demo}" horizontalAlign="center"/>

            In the code above, the first image (outside of the grid) is not displayed, but the second one (inside the grid) is shown.