0 Replies Latest reply on Nov 3, 2010 12:36 PM by txcody

    For hierarchicaldata as a dataprovider to an ADG, do CollectionChange events fire for the child?

    txcody

      I have an AdvancedDataGrid whose dataprovider is a hierarchicaldata.  This data has a top level ArrayCollection of objects, and then each object also has an ArrayCollection of a second object.  The data is bindable to my AdvancedDataGrid.  When the top level ArrayCollection changes, CollectionEvent.COLLECTION_CHANGE events are dispatched.  However, when the child ArrayCollection changes, these events do not get dispatched, which I would have thought they would have.

       

      How do I know when the child collections have changed?

       

       

      Here's my MXML:

       

      <fx:Declarations>
              <vh:Helper id="helper" _view="{this}"/>
      </fx:Declarations>

       

      <mx:AdvancedDataGrid id="applicationGrid"
                               width="100%"
                               height="100%"
                               editable="true"
                               sortExpertMode="true"
                               styleName="dataGrid"
                               alternatingItemColors="[0xFFFFFF, 0xE1F0FC]"
                               folderClosedIcon="{null}"
                               folderOpenIcon="{null}"
                               defaultLeafIcon="{null}">

       


              <mx:dataProvider> 
                  <mx:HierarchicalData source="{helper._searchData}"/> 
              </mx:dataProvider>

      .

      . <!-- omitted grid details -->

      .

      </mx:AdvancedDataGrid>

       

       

      Here's part of my ActionScript:

       

      public class Helper
      {
              [Bindable]
              [ArrayElementType("com.xxx.valueobjects.Application")]
              public var _searchData:ArrayCollection = new ArrayCollection();

      .

      .

      .

      .

      }

       

      Here are my valueobjects:

       

      package com.xxx.valueobjects
      {

          [Bindable]
          [RemoteClass(alias="com.xxx.ApplicationDTO")]
          public class Application
          {
              private var _applicationId:Number;
              private var _applicationName:String;

              // A collection of ApplicationRoles
              private var _children:ArrayCollection;

      .

      .

      .

      }

       

      package com.xxx.valueobjects
      {
          [Bindable]
          [RemoteClass(alias="com.xxx.ApplicationRoleDTO")]
          public class ApplicationRole
          {
              private var _applicationRoleId:Number;
              private var _roleName:String;.

      .

      .

      }