title: Show optgroup in selected values in selctize.js
body: <p>We have a selectize field where multiple values can be selected. These values are grouped in optgroups. To ease understanding, some values can be in multiple optgroups, we would like to see the name of the optgroup in the labels for the selected fields, too. How can we accomplish this?</p>
  
  <p>See following fiddle, if you select "First Item" you do not know which one was selected, Store or Warehouse. </p>
  
  <p>Thanks!</p>
  
  <p><a href="https://jsfiddle.net/4t8fjj7g/1/" rel="nofollow noreferrer">https://jsfiddle.net/4t8fjj7g/1/</a></p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;select name="test" id="test-select" multiple="multiple"&gt;
    &lt;optgroup label="Store"&gt;
      &lt;option data-type="stores" value="1"&gt;First item&lt;/option&gt;
      &lt;option data-type="stores" value="2"&gt;Second item&lt;/option&gt;
    &lt;/optgroup&gt;
    &lt;optgroup label="Warehouse"&gt;
      &lt;option data-type="warehouses" value="3"&gt;First item&lt;/option&gt;
      &lt;option data-type="warehouses" value="4"&gt;Second item&lt;/option&gt;
    &lt;/optgroup&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>And this is the javascript code:</p>
  
  <pre><code>$('select#test-select').selectize({
    searchField: ['text', 'type']
  });
  </code></pre>