DUDE! what the heck ? You must have copied out the labelFunction... thats not sortCompareFunction... it definitely requires two objects to compare!
Your example implementation even does a simple number format =) Nice try though. PW In the Language Reference, the only documentation for sortCompareFunction --- In [email protected], "michael_ramirez44" <[EMAIL PROTECTED]> wrote: > > --- In [email protected], "parkerwhirlow" > <parkerwhirlow@> 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]); > } >

