nl_tokens: Sorts the data in the Store by one or more of its properties . Example usage :
pl_tokens: function ( sorters , direction , where , doSort ) { var me = this , sorter , sorterFn , newSorters ; if ( Ext . isArray ( sorters ) ) { doSort = where ; where = direction ; newSorters = sorters ; } else if ( Ext . isObject ( sorters ) ) { doSort = where ; where = direction ; newSorters = [ sorters ] ; } else if ( Ext . isString ( sorters ) ) { sorter = me . sorters . get ( sorters ) ; if ( ! sorter ) { sorter = { property : sorters , direction : direction } ; newSorters = [ sorter ] ; } else if ( direction === undefined ) { sorter . toggle ( ) ; } else { sorter . setDirection ( direction ) ; } } if ( newSorters && newSorters . length ) { newSorters = me . decodeSorters ( newSorters ) ; if ( Ext . isString ( where ) ) { if ( where === 'prepend' ) { sorters = me . sorters . clone ( ) . items ; me . sorters . clear ( ) ; me . sorters . addAll ( newSorters ) ; me . sorters . addAll ( sorters ) ; } else { me . sorters . addAll ( newSorters ) ; } } else { me . sorters . clear ( ) ; me . sorters . addAll ( newSorters ) ; } if ( doSort !== false ) { me . onBeforeSort ( newSorters ) ; } } if ( doSort !== false ) { sorters = me . sorters . items ; if ( sorters . length ) { //construct an amalgamated sorter function which combines all of the Sorters passed sorterFn = function ( r1 , r2 ) { var result = sorters [ 0 ] . sort ( r1 , r2 ) , length = sorters . length , i ; //if we have more than one sorter, OR any additional sorter functions together for ( i = 1 ; i < length ; i ++ ) { <mask> = result || sorters [ i ] . sort . call ( this , r1 , r2 ) ; } return result ; } ; me . doSort ( sorterFn ) ; } } return sorters ; }