code: function (data) {
  
              var container=this.selection.find("span"), formatted;
  
              this.selection.data("select2-data", data);
  
              container.empty();
              formatted=this.opts.formatSelection(data, container);
              if (formatted !== undefined) {
                  container.append(this.opts.escapeMarkup(formatted));
              }
  
              this.selection.removeClass("select2-default");
  
              if (this.opts.allowClear && this.getPlaceholder() !== undefined) {
                  this.selection.find("abbr").show();
              }
          }
docs: single