title: Selectpicker val multiple select via data in function
body: <p>I cant seem to select multiple options after calling a function (onlick= edit_data). It works when the values is passed manuelly, however when the function is getting the info from a variable its not working. </p>
  
  <p>Here is the function</p>
  
  <pre><code>function edit_data(invoker,id){
      $('#gls_zones input[name="id"]').val($(invoker).data('id'));
      $('#gls_zones input[name="name"]').val($(invoker).data('name'));
  
      var countries = $(invoker).data('countries');
  
      $('#countries').selectpicker('val', [countries]);
      $('#countries').selectpicker('refresh');
  
      $('#gls_zones').modal('show');
  }
  
  
  &lt;td class="sorting_1" tabindex="0"&gt;&lt;a href="#" onclick="edit_data(this,7); return false;" data-id="7" data-name="Zone 1" data-countries="22,83,128,155"&gt;Zone 1&lt;/a&gt;&lt;/td&gt;
  </code></pre>
  
  <p><a href="https://jsfiddle.net/uz1Ln7xf/9/" rel="nofollow noreferrer">https://jsfiddle.net/uz1Ln7xf/9/</a></p>