I don’t believe we’ve said anything yet.  I’m hopeful it’s before the end of the month.

 

Matt

 


From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Harald Dehn
Sent: Monday, March 06, 2006 1:39 AM
To: [email protected]
Subject: AW: [flexcoders] DataGridColumn sortCompareFunction (Flex 2 Beta 1)

 

Thanks Matt,

 

so I am waiting for B2. Is there any public information about the date you are publishing B2?

 

Harry

 


Von: [email protected] [mailto:[EMAIL PROTECTED] Im Auftrag von Matt Chotin
Gesendet: Montag, 6. März 2006 07:50
An: [email protected]
Betreff: RE: [flexcoders] DataGridColumn sortCompareFunction (Flex 2 Beta 1)

 

Yes, the docs are wrong on b1 on the signature.  If you provided a custom comparator in b1 it may be that you need to know whether you wanted ascending or descending though I thought we were handing it correctly.  I’m pretty sure it behaves correctly in b2 though.

 

Matt

 


From: [email protected] [mailto:[email protected]] On Behalf Of Harald Dehn
Sent: Sunday, March 05, 2006 4:51 AM
To: [email protected]
Subject: [flexcoders] DataGridColumn sortCompareFunction (Flex 2 Beta 1)

 

Hello,

 

I do have some problemens with a custom sort compare function in a DataGrid. In the Columnn I like to sort birthdates of persons. Regarding the manunal the callback function should have the following signature

 

mySortCompareFunction(obj1 : Object, obj2 : Object, columnIndex : Number) : Number

 

With this signature I get the following error message

 

ArgumentError: Error #1063: Argument count mismatch on CellRenderer::DateCellRenderer/Compare(). Expected 3, got 2

            at mx.collections::Sort/mx.collections:Sort::internalCompare()

            at Array/sort() 

            […]

 

So I tried the following function with only two arguments:

 

                        var _ColumnName:String = “birthDate”;

 

                        public function Compare(pRow1:Object, pRow2:Object):Number {

                                   var _T1:Number;

                                   var _T2:Number;

                                   if( pRow1[_ColumnName] == null ) {

                                               if( pRow2[_ColumnName] == null )

                                                           return 0;

                                               else

                                                           return -1;

                                   }

                                   else _T1 = pRow1[_ColumnName].time;

                                   if( pRow2[_ColumnName] == null )

                                               return 1;

                                   else {

                                               _T2 = pRow2[_ColumnName].time;

                                               if( _T1 < _T2 ) return -1;

                                               if( _T1 > _T2 ) return 1;

                                               return 0;

                                   }

                        }

 

This works fine with one exception; the rows are always sorted ascend, even when the “sort arrow” indicates that the rows should be sorted descant.

 

Where is my mistake?

 

Harry






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




SPONSORED LINKS
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




Reply via email to