Apache flex Flex:如何更改绑定到data grid live的ArrayCollection?

Apache flex Flex:如何更改绑定到data grid live的ArrayCollection?,apache-flex,data-binding,arraycollection,Apache Flex,Data Binding,Arraycollection,我将一个ArrayCollection绑定到一个可编辑的DataGrid,另一个组件需要知道ArrayCollection何时更改(由于DataGrid中的更改),以便它也可以更新自身,监听ArrayCollection的COLLECTION\u更改事件也是如此 问题在于,DataGrid仅在正在编辑的行失去焦点时更新ArrayCollection。这对我的应用程序不好,因为用户可以编辑行上的一列,并且长时间不在表的其他位置单击(导致行丢失fucus),因此更改不会传播到应用程序的其他部分 如何

我将一个ArrayCollection绑定到一个可编辑的DataGrid,另一个组件需要知道ArrayCollection何时更改(由于DataGrid中的更改),以便它也可以更新自身,监听ArrayCollection的COLLECTION\u更改事件也是如此

问题在于,DataGrid仅在正在编辑的行失去焦点时更新ArrayCollection。这对我的应用程序不好,因为用户可以编辑行上的一列,并且长时间不在表的其他位置单击(导致行丢失fucus),因此更改不会传播到应用程序的其他部分

如何使数据网格在每次文本输入上出现键控事件而不是每一行失去焦点时通知ArrayCollection更改

干杯


Chris

我将把处理程序添加到用于编辑值的组件中,而不是添加到ArrayCollection中。例如:

<mx:DataGridColumn dataField="name" headerText="Name" itemEditor="{nameEditor}" editorDataField="selectedItem" />
\u currentlyEditedRowIndex
通过将其添加到网格中来设置:

itemEditBegin="beginEdit(event);"

我会将处理程序添加到用于编辑值的组件中,而不是添加到ArrayCollection中。例如:

<mx:DataGridColumn dataField="name" headerText="Name" itemEditor="{nameEditor}" editorDataField="selectedItem" />
\u currentlyEditedRowIndex
通过将其添加到网格中来设置:

itemEditBegin="beginEdit(event);"

谢谢加布里埃尔,你让我走上了正确的道路。我将在这里发布我的最终解决方案,以防将来其他人也需要这样做

  <mx:DataGridColumn headerText="Title" width="300" dataField="title">
    <mx:itemEditor>
      <mx:Component>
        <mx:TextInput change="data.title = text" />
      </mx:Component>
    </mx:itemEditor>
  </mx:DataGridColumn>


现在,每当在输入中更改文本时,用作数据提供程序的ArrayCollection也会更新,因此其他组件会侦听收集更改事件。

谢谢Gabriel,你让我走上了正确的道路。我将在这里发布我的最终解决方案,以防将来其他人也需要这样做

  <mx:DataGridColumn headerText="Title" width="300" dataField="title">
    <mx:itemEditor>
      <mx:Component>
        <mx:TextInput change="data.title = text" />
      </mx:Component>
    </mx:itemEditor>
  </mx:DataGridColumn>

现在,每当在输入中更改文本时,用作数据提供程序的ArrayCollection也会更新,因此其他组件会侦听COLLECTION\u更改事件