Derrell,

I see your point. But let's take away from developers to define
descending function. Qooxdoo framework can figure it out itself. Less
code is better. :)

I don't have time to look at the backend of qooxdoo right now, but
instead of setSortMethods we could use

...setSortMethod: function (sortAscMethod)
{
  var sortDescMethod = function (row1, row2) {return
sortAscMethod(row2, row1);};
  var sortMethods = {ascending: sortAscMethod, descending: sortDescMethod};
  ...
}



---
Ian

2009/7/6 Derrell Lipman <[email protected]>:
> On Fri, Jul 3, 2009 at 10:12 AM, Ian Horst <[email protected]> wrote:
>>
>> I wonder why there are 2 sort methods, one for ascending, second for
>> descending.
>>
>> It's enough to define ascending sort method. Descending is just
>> reverse of ascending sort method.
>>
>> ascending:
>> ascSortMethod();
>>
>> descending:
>> - ascSortMethod();
>
> Hi Ian,
>
> The sort method is passed to Array.sort(). According to my O'Reilly book,
> there's no mechanism for specifying that the sort order should be reversed.
> One could use the Ascending sort function to sort the array followed by a
> call to Array.reverse if a descending sort was requested, but that sounds
> mighty inefficient.
>
> Maybe there's a feature of a later version of Javascript (my book is old; it
> covers up through 1.5) that allows sorting in reverse, but I think we'd
> still need both sort functions anyway to support older browsers.
>
> Derrell
>
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
> qooxdoo-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>

------------------------------------------------------------------------------
_______________________________________________
qooxdoo-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel

Reply via email to