title: How to programmatically disable a choice in Chosen dropdown list
body: <p>I'm using the Chosen plugin for JQuery (<a href="https://harvesthq.github.io/chosen/" rel="noreferrer">https://harvesthq.github.io/chosen/</a>) and have selections working well. But i need to programmatically disable some choices in the dropdown based on selections, and can't find any workable examples. For example, if I select 'Item 1', 'Item 2' should be disabled.</p>
  
  <p>The rendered HTML for my dropdown list is:</p>
  
  <pre><code>&lt;div class="col-md-4"&gt;
            &lt;label&gt;Groups:&lt;/label&gt;
            &lt;select class="chosen-select" data-placeholder="Type to filter..." multiple="" style="display: none;"&gt;
            &lt;optgroup class="depth-0" label="Group 1" data-index="-1"&gt;
              &lt;option class="depth-1" value="Group 1" data-id="0" data-pid="-1"&gt;All items&lt;/option&gt;
              &lt;option class="depth-1" data-id="1" value="1" data-pid="-1"&gt;Item 1&lt;/option&gt;
              &lt;option class="depth-1" data-id="2" value="2" data-pid="-1"&gt;Item 2&lt;/option&gt;
              &lt;option class="depth-1" data-id="3" value="3" data-pid="-1"&gt;Item 3&lt;/option&gt;
              &lt;option class="depth-1" data-id="4" value="4" data-pid="-1"&gt;Item 4&lt;/option&gt;
            &lt;/optgroup&gt;
            &lt;optgroup class="depth-0" label="Group 2" data-index="-2"&gt;
              &lt;option class="depth-1" value="Group 2" data-id="0" data-pid="-2"&gt;All Items&lt;/option&gt;
              &lt;option class="depth-1" data-id="5" value="5" data-pid="-2"&gt;Item 5&lt;/option&gt;
              &lt;option class="depth-1" data-id="6" value="6" data-pid="-2"&gt;Item 6&lt;/option&gt;
              &lt;option class="depth-1" data-id="7" value="7" data-pid="-2"&gt;Item 7&lt;/option&gt;
              &lt;option class="depth-1" data-id="8" value="8" data-pid="-2"&gt;Item 8&lt;/option&gt;
            &lt;/optgroup&gt;
            &lt;/select&gt;
  
            &lt;div class="chosen-container chosen-container-multi" style="width: 2px;" title=""&gt;
            &lt;ul class="chosen-choices"&gt;
            &lt;li class="search-choice"&gt;&lt;span&gt;Item 1&lt;/span&gt;&lt;a class="search-choice-close" data-option-array-index="2"&gt;&lt;/a&gt;&lt;/li&gt;
            &lt;li class="search-field"&gt;&lt;input type="text" value="Type to filter..." class="" autocomplete="off" style="width: 25px;"&gt;&lt;/li&gt;&lt;/ul&gt;
  
            &lt;div class="chosen-drop"&gt;
            &lt;ul class="chosen-results"&gt;
              &lt;li class="group-result depth-0"&gt;Group 1&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="1"&gt;All items&lt;/li&gt;
              &lt;li class="result-selected group-option depth-1" data-option-array-index="2"&gt;Item 1&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="3"&gt;Item 2&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="4"&gt;Item 3&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="5"&gt;Item 4&lt;/li&gt;
            &lt;li class="group-result depth-0"&gt;Group 2&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="6"&gt;All items&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="7"&gt;Item 5&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="8"&gt;Item 6&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="9"&gt;Item 7&lt;/li&gt;
              &lt;li class="active-result group-option depth-1" data-option-array-index="10"&gt;Item 8&lt;/li&gt;
            &lt;/ul&gt;
  
            &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>