1 Reply Latest reply on Dec 25, 2007 7:41 AM by peterent

    Programmatic creation of inline itemrenderer

    gshumakher
      Hi,
      I have the following definition in MXML:
      <mx:DataGridColumn >
      <mx:itemRenderer>
      <mx:Component>
      <mx:HBox>
      <mx:Label text="{data.profile}" />
      <mx:Image source="assets\greenicon.gif" />
      </mx:HBox>
      </mx:Component>
      </mx:itemRenderer>
      </mx:DataGridColumn>

      What whould be the way to create the same definition programmatically in the script?

      I found that it is possible to write something like :
      var dgc:DataGridColumn = new DataGridColumn();
      dgc.itemRenderer = new ClassFactory(someclass);
      but this is based on some self-contained renderer class and not inline declaration.

      Thanks in advance,
      Gennady