Julio, you have an amazing memory then. It really helped me a lot, thanks so much.
----- Original Message ----- From: "Julio Carneiro" <[email protected]> To: [email protected] Sent: Thursday, May 2, 2013 12:35:43 PM Subject: Re: programmatic sort for Spark datagrid, accounting for sort triangle state Sorry mark, I wrote that code from the top of my head… see the fix to line #5. 'columns' is in iList, probably an ArrayList and [-] does not work there, you have to use getItemAt(). That way you can make it generic. And you do not need to clear up the dataProvider's sort, unless you have set it your self. Also, if you want to trap the DG sort on header click, you can either disable sorting altogether, or handle columnClick and deal with that yourself. cheers, julio On May 2, 2013, at 2:03 PM, [email protected] wrote: > private function redrawGrid():void { > arrCol.sort=null; > arrCol.refresh(); > myGrid.columnHeaderGroup.visibleSortIndicatorIndices = new <int>[0]; > myGrid.columns.getItemAt(0).sortDescending= true; // or false for ascending > arrow > } -- Julio Carneiro
