0 Replies Latest reply on Jun 4, 2007 3:08 PM by TigerLittle

    DataGrid when set variableRowHeight=true, the Image in the itemRenderer can't show up

    TigerLittle
      http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=cellrenderer_072_28.html

      the above is the flex example. I did my code almost same as this example. But I do different way in renderer code.
      The example:
      <?xml version="1.0"?>
      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml"
      horizontalAlign="center" >
      <mx:Image id="albumImage" height="175" source="{data.Cover}"/>
      </mx:HBox>

      My code:
      <?xml version="1.0"?>
      <mx:VBox xmlns:mx=" http://www.adobe.com/2006/mxml"
      dataChange="init();">

      <mx:Script>
      <![CDATA[
      public function init():void{
      releasedBox.removeAllChildren();
      if(data.releasedImage){
      var hbox:HBox = new HBox();
      var img:Image = new Image();
      var lbl:Label = new Label();
      img..source = data.Image;
      lbl.text = data.Revision;
      hbox.addChild(img);
      hbox.addChild(lbl);
      releasedBox.addChild(hbox);
      }

      ]]>
      </mx:Script>

      <mx:HBox id="releasedBox">
      </mx:HBox>
      </mx:VBox>



      The different is I add my image in AS code but not in mxml code. And the problem is when I set variableRowHeight=true, the datagrid can display my label, but image can’t display. And when mouse over, the data line is blinking. When you click one line, there can show the image for 1 sec.

      If I set variableRowHeight=false. It works fine.

      Anyone knows what’s this problem? Thanks