Create a numeric compare function like the following:

private function numericCompareFunc(itemA:Object, itemB:Object):int
{
     return ObjectUtil.numericCompare(itemA.itemToCompare,
itemB.itemToCompare);
}

Then set this function to the sortCompareFunction of your datagrid
column:

<mx:DataGridColumn sortCompareFunction="numericCompareFunc"/>


--- In flexcoders@yahoogroups.com, "AJC2357" <ajc2...@...> wrote:
>
> Hi all,
>
> Looking for a simple solution to properly sorting number values in a
datagrid.
>
> I'm sure many of you have run across this limitation.  Trying to sort
something like {1,5,100) turns into (1,100,5) because it is read a
string and not numeric.
>
> Suggestions?  Thanks,
>
> Alex
>


Reply via email to