This content has been marked as final. Show 4 replies
Every time you click on a header in a datagrid a "HeaderRelease" event is triggered. To prevent sorting, you need to call "preventDefault" on the event listener function. Its something like this...
<mx:DataGrid headerRelease="dontSort(event)" .....
private function dontSort(e:DataGridEvent):void
//whatever you want here
Thank you very much! One last thing: according to the API docs, "the sort arrows are defined by the default event handler for the headerRelease event. If you call the preventDefault() method in your event handler, the arrows are not drawn."
How might I go about showing the little arrow to indicate that a column is being sorted on?
There's a protected method of the DataGrid placeSortArrow() that "draws the sort arrow graphic on the column that is the current sort key." Is there a way to tell the DataGrid which column is the current sort key from my headerRelease event handler? Then would I have to call the placeSortArrow method somehow? It's a protected method, so could I call it if I extended the DataGrid and called it from my custom DataGrid?
Or am I better off appending a symbol to the end of the text of the header that's clicked?
hi , I also have the same requirement as you, have you settled down the problem of sort arrows? could you please give me some suggestion?