FLEX datagrid 点击列头排序后,行编辑问题

点击列头排序后。行编辑事件结束后,adobe默认会自己重新将dataprovider 更新下,

 

如果自己的行编辑有级联更新,就是说用上了

 

dtableGrid.dataProvider[rowIndex] = resultData;				
dtableGrid.dataProvider.itemUpdated(dtableGrid.dataProvider[rowIndex]);

 itemUpdated 这个方法。 这个是手动更新数据。

 

这个时候为了防止出现行编辑事件结束后,出现数据修改不对应的问题。

 

就需要在行编辑 end 方法里面最后一行加上

 

(dtableGrid.dataProvider as ArrayCollection).disableAutoUpdate();

 

就是不让datagrid 自己更新数据。

 

然后在自己手动更新前加上

 

(dtableGrid.dataProvider as ArrayCollection).enableAutoUpdate();

 

不加的话,会无法更新数据。

你可能感兴趣的:(datagrid,Flex,itemUpdated,AutoUpdate)