title: how to let jquery select2 disable one option dynamically?
body: <p>I have some multiselect and i use jquery select2.I want to disable one option in other multiselect when this option is selected in one multiselect.
  i write this code,but it does work.</p>
  
  <pre><code>$("select.multiselect").on("change", function(e) {
      if(e.added){
          for(var i=0;i&lt;this.options.length;i++){
              var vals = $(this).select2("val");
              for(var j=0;j&lt;vals.length;j++){
                  if(this.options[i].value===vals[j]){
                      this.options[i].selected=true;
                  }
              }
          };
      }
  
      if(e.removed){
          for(var i=0;i&lt;this.options.length;i++){
              if(this.options[i].value===e.removed.id){
                  this.options[i].selected=false;
              }
          };
      }
  });
  </code></pre>
  
  <p>how to do it?</p>