title: Setting bootstrap-select value with array but preserving array order (instead sorting alphabetically)
body: <p>This should be simple and common, but my Google skills are failing me.</p>
  
  <p>I'm using <code>bootstrap-select</code> to create a dropdown menu where users can select up to 3 options, initialized like so:</p>
  
  <pre><code>$('#PItypeSelect').selectpicker({
      maxOptions: 3,
  });
  </code></pre>
  
  <p>Let's say this is the HTML:</p>
  
  <pre><code>&lt;select id='PItypeSelect' multiple&gt;
      &lt;option&gt;A&lt;/option&gt;
      &lt;option&gt;B&lt;/option&gt;
      &lt;option&gt;C&lt;/option&gt;
      &lt;option&gt;D&lt;/option&gt;
      &lt;option&gt;E&lt;/option&gt;
  &lt;/select&gt;"
  </code></pre>
  
  <p>And now I'd like to set the selected options from an array, for example <code>tipo = ['B','A','C']</code>, but no matter what I try, it always ends up being displayed as <code>A, B, C</code> instead of <code>B, A, C</code>.</p>
  
  <p>Neither</p>
  
  <pre><code>$('#PItypeSelect').selectpicker('val', tipo);
  </code></pre>
  
  <p>nor</p>
  
  <pre><code>$('#PItypeSelect').val(tipo);
  $('#PItypeSelect').selectpicker('refresh');
  </code></pre>
  
  <p>work, and I've had no luck googling this issue. Does anyone have a workaround?</p>