0 Replies Latest reply on Dec 14, 2009 10:17 PM by acoquinar

    Bug with advancedDataGrid !!!  ("groupIconFunction"  not working properly)


      Suprisingly, the following code doesn't set an icon for the tree's second level of items.


      XML data is simplified here but it's only to make this simpler to read. (Just replace the path to your image file and run the thing. Have fun !)


      <?xml version="1.0"?>
      <!-- dpcontrols/adg/SimpleHierarchicalADGGroupIcon.mxml -->
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
                import mx.collections.ArrayCollection;
              //  include "SimpleHierarchicalData.as";
               // Embed the icon for the groups.
                      public var hd:Class;
                      public var r:Class;
               // Define the groupIconFunction callback function.
               public function myIconFunc(item:Object, depth:int):Class {
                   if(depth == 1)
                       // If this is the top-level of the tree, return the icon.
                       return hd;
                   if(depth == 2)
                       // If this is the top-level of the tree, return the icon.
                       return r;
                       // If this is any other level, return null.
                       return null;
       <mx:XMLList id="dpHierarchyXML" >
        <Region Region="Southwest">
         <Region Region="Arizona" Territory_Rep="Barbara Jennings" Actual="38865" Estimate="40000">
              width="100%" height="100%"
               displayItemsExpanded="true" >
                  <mx:HierarchicalData source="{dpHierarchyXML}"/>
                  <mx:AdvancedDataGridColumn dataField="@Region" itemRenderer="itemRender"/>
                  <mx:AdvancedDataGridColumn dataField="@Territory_Rep"
                      headerText="Territory Rep"/>
                  <mx:AdvancedDataGridColumn dataField="@Actual"/>
                  <mx:AdvancedDataGridColumn dataField="@Estimate"/>