0
votes

I have an AdvancedDataGrid (whose dataProvider is a variable being bound from my main mxml file, not sure if this is relevant to my problem ). I'm setting one of the AdvancedDataGridColumn's editable property as true, and when I click on the cell in the UI, it is infact editable. But when I press enter/move to a different cell, the old value returns and the newly entered value is lost. Would anyone have any ideas why that's happening? Do I have to manually change the variable provided in the dataProvider?...I would think that would happen automatically right? I'd appreciate any help!

Thanks.

1
You should post some code or a simple example. In the most simplest case, the newly edited cell retains it's value after being edited.Sunil D.
Show some code for your AdvancedDataGrid along with the editable column, especially with your itemEditor.JeffryHouser
Sorry for the late reply. It's flex 4. It's actually some proprietary code, and I'm not sure I understand it well enough to simplify and post an example here. Sorry for wasting ya'lls time.iman453

1 Answers

0
votes

This traces out correct when I edit a field and press enter then click on the button to see trace output:

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
               xmlns:s="library://ns.adobe.com/flex/spark" 
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" applicationComplete="init()">
        <fx:Declarations>
          <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <fx:Script>
          <![CDATA[
            import mx.collections.HierarchicalData;
            [Bindable]
            private var companyHierarchy:HierarchicalData;

            private var companyData:XML = <data>
                        <company name="Employees">
                          <department name="Unit 1">
                            <employee name="Dave" func="C# Developer"/>
                            <employee name="Bob" func="AS3 Developer"/>
                            <employee name="Clair" func="AS3 Architect"/>
                          </department>
                          <department name="Unit 2">
                            <employee name="John" func="ORACLE Developer"/>
                            <employee name="Sandra" func="HTML Developer"/>
                          </department>
                        </company>
                      </data>;


            private function init():void
            {
              companyHierarchy = new HierarchicalData(companyData.company);
            }

            private function checkSetData():void
            {
              trace(companyData);
            }
          ]]>
        </fx:Script>
        <mx:AdvancedDataGrid id="test" width="500" height="500" dataProvider="{companyHierarchy}"
                   displayItemsExpanded="true" editable="true" enabled="true">
          <mx:columns>
            <mx:AdvancedDataGridColumn dataField="@name"
                           headerText="Companies"/>
            <mx:AdvancedDataGridColumn dataField="@func"
                           headerText="Function"/>
          </mx:columns>
        </mx:AdvancedDataGrid>
        <s:Button x="205" y="508" label="Button" click="checkSetData()"/>
      </s:Application>