Class o2.SortDelegate


static class o2.SortDelegate

Custom delegates for Array.sort method.

Defined in sortdelegate.core

Function Summary
static sort()

A generic sort function.

If the collecion consists of Strings and Numbers, Strings will be stored alphabeticaly at the bottom, and Numbers will be sorted numerically before them.

Usage example:

 var ar = [1, 7, '12', 8, 'lorem', 'c', 42, 7];
 a.sort(o2.SortDelegatae.sort);
 
static sortAsc()

An alias to o2.SortDelegate.sort.

static sortDesc()

Works similar to {link o2.SortDelegate.sort}. The only difference is that the items are sorted in a descending order.

Usage example:

 var ar = [1, 7, '12', 8, 'lorem', 'c', 42, 7];
 a.sort(o2.SortDelegatae.sortDesc);
 

Function Details

function sort

static sort()

A generic sort function.

If the collecion consists of Strings and Numbers, Strings will be stored alphabeticaly at the bottom, and Numbers will be sorted numerically before them.

Usage example:

 var ar = [1, 7, '12', 8, 'lorem', 'c', 42, 7];
 a.sort(o2.SortDelegatae.sort);
 

function sortAsc

static sortAsc()

An alias to o2.SortDelegate.sort.


function sortDesc

static sortDesc()

Works similar to {link o2.SortDelegate.sort}. The only difference is that the items are sorted in a descending order.

Usage example:

 var ar = [1, 7, '12', 8, 'lorem', 'c', 42, 7];
 a.sort(o2.SortDelegatae.sortDesc);