Search code examples
actionscript-3apache-flexactionscriptmxml

store a boolean for when the column header that reverses sorting order is clicked


I have a datagrid and by default, you can click on the header of each column to reverse the sorting order. Is there a way to store a boolean to indicate that the sorting order was switched?

This is an image of when the header has been clicked and the down arrow indicates that the order has switched.


Solution

  • To detect when the user changes the sort, listen to the headerRelease event of the DataGrid (if using mx DataGrid) or sortChange event (if using spark DataGrid).