--- In [email protected], "parkerwhirlow"
<[EMAIL PROTECTED]> wrote:
>
>
> Its amazing how complicated something so seemingly easy can be...
>
> All I want to do is provide a numeric sort for columns that contain
> numeric data. (by default the sorting is all text based)
>
> I found the DataGridColumn.sortCompareFunction and tried this.
>
> The problem I have is that the objects passed to the function are
the
> entire row, and I have no context of which column the sort is for.
>
> It seems like they left out some key information in the signatures
of
> some of the DataGrid functions... for instance labelFunction
signature
> has the column being rendered but dataTipFunction does not.
Therefore
> I have the same issue with dataTipFunction as I do with
> sortCompareFunction... how do you know what column you're working
with?
>
> Anyone know any tricks? How have others implemented custom sorting
of
> datagrids?
>
> thanks,
> PW
>
The signature on the SortCompareFunction:
private function sortNumber(item:Object,column:DataGridColumn):String
{
return numFormatter.format(item[column.dataField]);
}