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?
精彩评论