The code below demonstrates the problem.  Although I am not
specifically typing margin revenue to a number I think AS3 is doing it
since I don't have quotes.  In my real application i am using a class
that does type it to Number.

Just try to sort the marginRevenue column and you'll see what I mean.

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
layout="absolute">
<mx:Script>
        <![CDATA[
                import mx.collections.ArrayCollection;
                [Bindable]private var testChartData:ArrayCollection = new
ArrayCollection([{marginRevenue: 6472891.20, theme: 'Theme1'}, 
                                                                                
                                                                                
{marginRevenue: 4101969.11, theme: 'Theme2'}, 
                                                                                
                                                                                
{marginRevenue: 28022462.23, theme: 'Theme3'}, 
                                                                                
                                                                                
{marginRevenue: 16559240.25, theme: 'Theme4'}, 
                                                                                
                                                                                
 ]);     
        ]]>
</mx:Script>
        <mx:CurrencyFormatter precision="0" id="cf"/>
        <mx:AdvancedDataGrid id="adgThemeList"   draggableColumns="false"
selectable="false" dataProvider="{testChartData}" width="100%"
height="100%">
                                <mx:columns>
                                        <mx:AdvancedDataGridColumn 
dataField="theme" headerText="Theme"/>
                                        <mx:AdvancedDataGridColumn 
id="fieldSort"
dataField="marginRevenue" textAlign="right" formatter="{cf}" 
headerText="Total Revenue"/>
                                </mx:columns>
                        </mx:AdvancedDataGrid>
</mx:Application>


--- In flexcoders@yahoogroups.com, "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Please post a test case or file a bug.  Maybe we goofed somewhere.
> 
> ________________________________
> 
> From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
> Behalf Of Nate Pearson
> Sent: Tuesday, October 02, 2007 9:26 AM
> To: flexcoders@yahoogroups.com
> Subject: [flexcoders] Re: My column doesn't sort correctly in Flex 3
> Beta 2
> 
> 
> 
> actually, my data is of type number and I am using a label function to
> display it in a currency format. I just used the commas to improve
> readability for my forum post.
> 
> here is the actual data:
> 
> 16559240.56
> 28022462.90
> 4101969.43
> 6472891.11
> 
> --- In flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > If your data is 28,000,000, the DG will now sort alphabetically
> because
> > that isn't number, but rather a string. I actually think the old
> > behavior just chopped off 28, 16, 6 and 4 and sorted by those numbers
> > such that 28,123,456 and 28,234,567 weren't guaranteed to be ordered.
> > 
> > 
> > 
> > If you want numeric sorting, data should be of type int or Number and
> a
> > labelFunction should be used to format what you see.
> > 
> > 
> > 
> > This behavior become more strict in order to fix a bug where there was
> > no way to specify non-numeric sorts in mixed alpha/number strings.
> > 
> > 
> > 
> > ________________________________
> > 
> > From: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> [mailto:flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Nate Pearson
> > Sent: Monday, October 01, 2007 4:56 PM
> > To: flexcoders@yahoogroups.com <mailto:flexcoders%40yahoogroups.com> 
> > Subject: [flexcoders] My column doesn't sort correctly in Flex 3 Beta
> 2
> > 
> > 
> > 
> > My column used to sort correctly, IE:
> > 28,000,000
> > 16,000,000
> > 6,000,000
> > 4,000,000
> > 
> > Now in Beta 2 with no code changes I get:
> > 16,000,000
> > 28,000,000
> > 4,000,000
> > 6,000,000
> > 
> > What gives? Is it sorting it alphabetically? If so how do I change
> > it back to the way it was?
> > 
> > Thanks,
> > 
> > Nate
> >
>


Reply via email to