1

I"m using Flex 4 and an AdvancedDataGrid. I need to keep track of the previously selected item. I can't think of where to capture this though. In an itemClickHandler method, the grid's selectedItem value is already the current selected item.

The focusIn and focusOut attributes apply to the whole datagrid, not to just one row in the datagrid.

Thank you. Bonnie

bon_t
  • 97
  • 1
  • 7

2 Answers2

2
public function yourConstructor(){
   ChangeWatcher.watch(yourAdvancedDataGrid, "selectedItem",someHandler);
}

public var oldSelectedItem:Object;

protected function someHandler(event:PropertyChangeEvent):void{
   oldSelectedItem = event.oldValue;
}
Kevin Gallahan
  • 1,645
  • 10
  • 9
  • Good answer. Another solution would be to extend your grid to add a new property like 'previousSelectedItem' and override the selected item handler. – J_A_X Apr 14 '11 at 13:31
  • I tried it, but the grid fires (in order) a FlexEvent and a ListEvent while the handler expect a PropertyChangeEvent, so it ends in a runtime exception. – Giorgio Gelardi May 07 '12 at 11:31
0

Try it on event itemFocusOut

Imran
  • 2,906
  • 1
  • 19
  • 20