0 Replies Latest reply on Oct 22, 2009 6:42 AM by eliza_doolittle

    Item editor in AdvancedDataGrid not reflecting changes in dataprovider

    eliza_doolittle

      Hi,

       

           I have an AdvancedDataGrid that uses a hierarchical data provider.  The child data that's shown at depth 2 is a String, which I want to be able to edit.  When I make a change in the TextInput control, which is the renderer for the data at depth 2, I can see that the field has been edited.  However, as soon as a refresh of the display happens (such as when I open the child for a different row), the changes I made in the TextInput go away - the ArrayCollection configured as the dataprovider remains unmodified.

       

           The dataprovider is configured as Bindable:

       

                  [Bindable]
                  [ArrayElementType("vo.DocumentVO")]       
                  private var documents:ArrayCollection;

       

           The VO is defined as:

       

       

      package vo
      {
          [Bindable]
          public class DocumentVO
          {
              import mx.collections.ArrayCollection;
             
              public var isSelected:Boolean;
              public var itemType:String;
              public var department:String;
              public var docType:String;
              public var docDesc:String;
              public var children:ArrayCollection;

           }

      }

       

           Here's the ADG definition:

       

          <mx:AdvancedDataGrid id="docsDataGrid" width="100%" height="100%" allowMultipleSelection="true" sortableColumns="true" variableRowHeight="false"
                  defaultLeafIcon="{null}" folderClosedIcon="{null}" folderOpenIcon="{null}" editable="true"
                  displayItemsExpanded="false" treeColumn="{selectTreeColumn()}">
              <mx:dataProvider>
                      <mx:HierarchicalData id="docsGridHeirarchicalData" source="{documents}"/>
                  </mx:dataProvider>
              <mx:columns>
                  <mx:AdvancedDataGridColumn id="col1" headerText="" textAlign="center" width="50" sortable="false" dataField="isSelected" editable="false"/>
                  <mx:AdvancedDataGridColumn id="col2" headerText="Department" dataField="department"/>
                  <mx:AdvancedDataGridColumn id="col3" headerText="Item Type" dataField="itemType" itemRenderer="mx.controls.Label" itemEditor="mx.controls.TextInput"/>
                  <mx:AdvancedDataGridColumn id="col4" headerText="Document Type" dataField="docType" itemRenderer="mx.controls.Label" mx.controls.TextInput/>
                  <mx:AdvancedDataGridColumn id="col5" headerText="Document Desc" dataField="docDesc" itemRenderer="mx.controls.Label" itemEditor="mx.controls.TextInput"/>
                  <mx:AdvancedDataGridColumn id="col6" headerText="Person Number" dataField="personNumber" itemRenderer="mx.controls.Label"/>
              </mx:columns>
               <mx:rendererProviders>
                  <mx:AdvancedDataGridRendererProvider column="{col1}" depth="1" renderer="renderers.SelectControlRenderer"/>
                  <!-- The IgnoreRenderer prevents the comment from being shown in the first column when the row is expanded -->
                   <mx:AdvancedDataGridRendererProvider column="{col1}" depth="2" renderer="renderers.IgnoreRenderer"/>
                  <mx:AdvancedDataGridRendererProvider id="commentRenderer" column="{col2}" depth="2" columnSpan="0" renderer="mx.controls.TextInput"/>
              </mx:rendererProviders>


           The edits for any of the data at depth 1 works, its just the child data that doesn't.  Any help would be appreciated.

       

      Thanks!