nl_tokens: Reorders each of the items based on a mapping from old index to new index . Internally this just translates into a sort . The sort event is fired whenever reordering has occured .
pl_tokens: function ( mapping ) { var me = this , items = me . items , index = 0 , length = items . length , order = [ ] , remaining = [ ] , oldIndex ; me . suspendEvents ( ) ; //object of {oldPosition: newPosition} reversed to {newPosition: oldPosition} for ( oldIndex in mapping ) { order [ mapping [ oldIndex ] ] = items [ oldIndex ] ; } for ( index = 0 ; index < length ; index ++ ) { if ( mapping [ index ] == undefined ) { remaining . push ( items [ index ] ) ; } } for ( index = 0 ; index < length ; index ++ ) { if ( order [ index ] == undefined ) { <mask> [ index ] = remaining . shift ( ) ; } } me . clear ( ) ; me . addAll ( order ) ; me . resumeEvents ( ) ; me . fireEvent ( 'sort' , me ) ; }