开发者

Flex Cairngorm - How to update the model without losing focus in Datagrid?

开发者 https://www.devze.com 2022-12-17 20:28 出处:网络
In my Flex Project using Cairngorm, I have a model that stores a bindable ArrayCollection displayed by a DataGrid. My problem occurs when the 开发者_开发问答model is updated by the responder (from a J

In my Flex Project using Cairngorm, I have a model that stores a bindable ArrayCollection displayed by a DataGrid. My problem occurs when the 开发者_开发问答model is updated by the responder (from a Java service, after an "update" event), because the focus located in a cell of the DataGrid is lost (the scroll position il also lost). So, I retrieve the position before the update, with DataGridEvent.ITEM_FOCUS_IN event :

myModel.focusedCell.rowIndex = e.rowIndex;
myModel.focusedCell.columnIndex = e.columnIndex;

But, from where restore these parameters ? How to trigger this update only when the model is updated ?

Thanks in advance.


for information, I resolved my problem as follows:

to avoid losing focus (or rather the next cell being edited), one has to update the model without re-instantiating it.

After that, we must resolve a problem with the scroll as explained in the following post: How to data bind DataGrid component without scrolling up?

0

精彩评论

暂无评论...
验证码 换一张
取 消