I've added an eventListener to the COLLECTION_CHANGE event that is fired when the grid is finished resorting the items in its dataProvider, after the user clicks on a column header:
MyType (myDataGrid.dataProvider).addEventListener(CollectionEvent.COLLECTION_CHANGE, onDataGridResort); ... private function onDataGridResort(e:CollectionEvent) : void { }
MyDataGrid has some custom helper methods for working with the dataProvider and it would be useful to have access to them from inside the onDataGridResort function. Can I get access to the datagrid to which the dataProvider has been attached? When I examine "e" (CollectionEvent) in the debugger, I see
[inherited] currentTarget listeners [0] [1] [2] savedThis MyDataGrid
It seems an unreliable way to get at the grid component from inside this eventhandler -- will the grid always be found at property savedThis at offset [2] in the listeners array beneath currentTarget?