views:

193

answers:

1

Hi,

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.

A: 

Hello,

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: http://stackoverflow.com/questions/1812138/how-to-data-bind-datagrid-component-without-scrolling-up

Phil