0 Replies Latest reply on Feb 4, 2010 9:01 AM by GeorgeWS

    ADG more than one rendererProvider

    GeorgeWS Level 1

      I have a ADG with grouping, I pull in an extra field that does not get summed just displayed. So I have Accounts and Account addresses. The addresses being the 2nd column in the grid works perfect. But I want to pull in a 3rd column "City" but all I can get is a NaN in the column. Here is what my renderer is like:

       

      <mx:rendererProviders>

       

       

      <mx:AdvancedDataGridRendererProvider dataField="Address"

      columnIndex="

      1"

      depth="

      1"

      renderer="

      com.esria.samples.dashboard.view.AddressRenderer"/>

       

       

      <mx:AdvancedDataGridRendererProvider dataField="City"

      columnIndex="

      2"

      depth="

      1"

      renderer="

      com.esria.samples.dashboard.view.CityRenderer"/>

       

       

      </mx:rendererProviders>

       

      This is my City column renderer:

       

      <mx:Canvas

       

      xmlns:mx="http://www.adobe.com/2006/mxml" horizontalScrollPolicy="off">

       

      <mx:Label id="rowLabel" textAlign="left" width="100%">

       

      <mx:Script>

      <![CDATA[

       

      import mx.collections.ArrayCollection;

       

       

      override public function set data(value:Object):void

      {

       

      super.data = value;

       

       

      try

      {

       

      var groupChildren : ArrayCollection = data.children as ArrayCollection;

       

      if ( groupChildren.length > 0 )

      {

       

      var firstRowInGroup : Object = groupChildren[ 0 ];

      rowLabel.htmlText = firstRowInGroup.City;

      }

       

      else

      {

      rowLabel.htmlText =

      "n/a";

      }

      }

       

      catch ( e : Error )

      {

      rowLabel.htmlText = e.message;

      }

      }

       

        

       

      ]]>

       

      </mx:Script>

       

       

      </mx:Label>

      </mx:Canvas>

       

       

       

      There is an Address renderer that is just like above except that it has Address instead of City. Is this possible?

      Seems like it would be super easy.

       

      Thanks

       

      George