0 Replies Latest reply on Apr 27, 2007 6:23 AM by gaiz2000

    Containers as Itemem Renderer

    gaiz2000
      I am using the following code with intention of rendering this column as two labels inside a HBOX:

      <mx:DataGridColumn headerRenderer="renderers.FcModelContTotalHead20"
      itemRenderer="renderers.FcModelContTotal0"
      dataField="0"
      id="mdt20" />


      Here is part of "FcModelContTotal0":
      <mx:HBox xmlns:mx=" http://www.adobe.com/2006/mxml"
      preinitialize="initLB();">
      <mx:HBox width="55%" borderStyle="solid" borderSides="right" horizontalAlign="right" paddingBottom="0" paddingTop="0">
      <mx:Label id="ctns" textAlign="right" paddingRight="3" />
      </mx:HBox>
      <mx:HBox width="45%" horizontalAlign="right" paddingBottom="0" paddingTop="0">
      <mx:Label
      id="units" textAlign="right"/>
      </mx:HBox>

      <mx:Script>
      <![CDATA[

      public function initLB():void {
      addEventListener("dataChange", handleDataChanged);
      }
      public function handleDataChanged(event:Event):void {
      var idx:int = 0;
      if (data) {
      var fsl:ForecastSkuLine = ForecastSkuLine(data);
      ............
      units.text = df.format(Number(fsl.getUnitTotals()[idx]));
      ctns.text = df.format(Number(fsl.getCtnTotals()[idx]));
      }
      }
      ]]>
      </mx:Script>
      </mx:HBox>

      The problem is that I cannot retrieve "dataField" value from listData since it is not passed to HBox in this case.

      Any ideas?

      Sorry for the long msg.