Figured it out.  Good example here. 
http://tech.groups.yahoo.com/group/flexcoders/message/40149

--- In flexcoders@yahoogroups.com, "jnewport" <[EMAIL PROTECTED]> wrote:
>
> I was wondering if any had an easy to follow sortCompareFunction tut
> or example to follow.
> 
> I am trying to sort datagrid columns that have had a labelFunction
> applied to them.  Since teh labelFunction is being used I need to
> create a custom sortCompareFunction....according to the Flex
> documentation.  
> 
> I cannot seem to get it to work correctly.  My "$" in my revenue
> Column seems to be causing issues.
> 
> my data provider is as follows"
> <mx:DataGridColumn
> headerText="{(selectioncombobox.selectedItem.toString())}"
> dataField="@{lowerCase(selectioncombobox.selectedItem.toString())}" 
> 
> My dataProvider is an XMLListCollection so I have to use the "@" symbol.
> 
> So this is what I have as my sort function:
> 
> public static function sortDifference(obj1:Object, obj2:Object):Number
>         {
>                       if ([EMAIL PROTECTED] == [EMAIL PROTECTED]){
>                     return 0;
>                 }else if ([EMAIL PROTECTED] < [EMAIL PROTECTED]){
>                     return -1;
>                 }else{
>                     return 1;
>                 }
>         }
> 
> This is not working correctly.  Any suggestions?
>





--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to