function() {

            var val=[], self=this;

            // show search and move it to the end of the list
            this.searchContainer.show();
            // make sure the search container is the last item in the list
            this.searchContainer.appendTo(this.searchContainer.parent());
            // since we collapsed the width in dragStarted, we resize it here
            this.resizeSearch();

            // update selection
            this.selection.find(".select2-search-choice").each(function() {
                val.push(self.opts.id($(this).data("select2-data")));
            });
            this.setVal(val);
            this.triggerChange();
        }
function() {

            var val=[], self=this;

            
            this.searchContainer.show();
            
            this.searchContainer.appendTo(this.searchContainer.parent());
            
            this.resizeSearch();

            
            this.selection.find(".select2-search-choice").each(function() {
                val.push(self.opts.id($(this).data("select2-data")));
            });
            this.setVal(val);
            this.triggerChange();
        }
function ( ) { var val = [ ] , self = this ; // show search and move it to the end of the list this . searchContainer . show ( ) ; // make sure the search container is the last item in the list this . searchContainer . appendTo ( this . searchContainer . parent ( ) ) ; // since we collapsed the width in dragStarted, we resize it here this . resizeSearch ( ) ; // update selection this . selection . find ( ".select2-search-choice" ) . each ( function ( ) { val . push ( self . opts . id ( $ ( this ) . data ( "select2-data" ) ) ) ; } ) ; this . setVal ( val ) ; this . triggerChange ( ) ; }
multi
multi