문제

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?

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top