Search code examples
actionscript-3apache-flexflex3

Datagrid is scrolling up on data refresh


Here is what is happening:

  1. I have a datagrid (which I am generating dynamically)
  2. If I select a row and edit it (on clicking it opens a pop up and when i save data in that, I just update the data provider of the grid locally).
  3. As soon as data provider of datagrid is updated, the datagrid scrolls up in a way so that selected row comes at the top of datagrid.

Has someone ever crossed this issue? Thanks.


Solution

  • If you are using a

    dataProvider.refresh();
    

    Consider changing this to

    dataProvider.itemUpdated(item);
    

    The .refresh() sends a 'refresh' type event that causes the dataGrid to change. The itemUpdated(item) method does not dispatch this event.