I'm having some trouble with an editable DataGrid... I have one
DataGrid that is editable, and then a List that is not.

The List is bound to an XMLListCollection (Same thing happens
ArrayCollection), which gets items added to it constantly.

Now, when I click one of the columns in the editable DataGrid, the
itemeditor gets opened, but is closed the moment the second DataGrid
is updated... (If I use a DataGrid instead of a List as the second
item, the closing of the ItemEditor only seems to happen once the
second DataGrid has enough items to create a ScrollBar).

Has anyone else experienced this, and does anyone know of a solution?

Example Code:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="vertical" creationComplete="onCreated(event)" xmlns:local="*">
  <mx:Script>
    <![CDATA[
      import mx.collections.ArrayCollection;
      
      [Bindable]
      private var dp1:ArrayCollection;
      [Bindable]
      private var dp2:ArrayCollection;
      private var t:Timer;
      private function onCreated(event:Event):void
      {
        dp2 = new ArrayCollection();
        dp2.addItem({b:"Try editing this"});
        
        t = new Timer(1000);
        t.addEventListener(TimerEvent.TIMER, onTimer);
        t.start();
        
        dp1 = new ArrayCollection();
      }      
      private function onTimer(event:TimerEvent):void{
        dp1.addItem({a:"1"});
      }

    ]]>
  </mx:Script>
  
  <mx:DataGrid dataProvider="{dp2}" editable="true">
    <mx:columns>
      <mx:DataGridColumn headerText="test" dataField="b" editable="true"/>
    </mx:columns>
  </mx:DataGrid>
  <mx:List dataProvider="{dp1}" labelField="a"/>
</mx:Application>




Reply via email to