Question

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.

Was it helpful?

Solution

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?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top