nl_tokens: Sorts the collection by a single sorter function .
pl_tokens: 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 . <mask> . 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 ) ; }