function(sorterFn) {
        var me     = this,
            items  = me.items,
            keys   = me.keys,
            length = items.length,
            temp   = [],
            i;

        //first we create a copy of the items array so that we can sort it
        for (i = 0; i < length; i++) {
            temp[i] = {
                key  : keys[i],
                value: items[i],
                index: i
            };
        }

        Ext.Array.sort(temp, function(a, b) {
            var v = sorterFn(a.value, b.value);
            if (v === 0) {
                v = (a.index < b.index ? -1 : 1);
            }

            return v;
        });

        //copy the temporary array back into the main this.items and this.keys objects
        for (i = 0; i < length; i++) {
            items[i] = temp[i].value;
            keys[i]  = temp[i].key;
        }

        me.fireEvent('sort', me, items, keys);
    }
function(sorterFn) {
        var me     = this,
            items  = me.items,
            keys   = me.keys,
            length = items.length,
            temp   = [],
            i;

        //first we create a copy of the items array so that we can sort it
        for (i = 0; i < length; i++) {
            temp[i] = {
                key  : keys[i],
                value: items[i],
                index: i
            };
        }

        Ext.Array.sort(temp, function(a, b) {
            var v = sorterFn(a.value, b.value);
            if (v === 0) {
                v = (a.index < b.index ? -1 : 1);
            }

            return v;
        });

        //copy the temporary array back into the main this.items and this.keys objects
        for (i = 0; i < length; i++) {
            items[i] = temp[i].value;
            keys[i]  = temp[i].key;
        }

        me.fireEvent('sort', me, items, keys);
    }
function ( sorterFn ) { var me = this , items = me . items , keys = me . keys , length = items . length , temp = [ ] , i ; //first we create a copy of the items array so that we can sort it for ( i = 0 ; i < length ; i ++ ) { temp [ i ] = { key : keys [ i ] , value : items [ i ] , index : i } ; } Ext . Array . sort ( temp , function ( a , b ) { var v = sorterFn ( a . value , b . value ) ; if ( v === 0 ) { v = ( a . index < b . index ? - 1 : 1 ) ; } return v ; } ) ; //copy the temporary array back into the main this.items and this.keys objects for ( i = 0 ; i < length ; i ++ ) { items [ i ] = temp [ i ] . value ; keys [ i ] = temp [ i ] . key ; } me . fireEvent ( 'sort' , me , items , keys ) ; }
Sorts the collection by a single sorter function.
@param {Function} sorterFn The function to sort by.
Sorts the collection by a single sorter function .