bon_t
bon_t

Reputation: 97

Flex 4 - How do I keep track of last selectedItem in datagrid?

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

Upvotes: 1

Views: 664

Answers (2)

Kevin Gallahan
Kevin Gallahan

Reputation: 1664

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

public var oldSelectedItem:Object;

protected function someHandler(event:PropertyChangeEvent):void{
   oldSelectedItem = event.oldValue;
}

Upvotes: 2

Imran
Imran

Reputation: 3024

Try it on event itemFocusOut

Upvotes: 0

Related Questions