title: Jquery select2 prefill data issue
body: <p>I want to prefill the datas in the select2 </p>
  
  <p>Here is the response from server</p>
  
  <p><a href="https://jsfiddle.net/j6tv52s6/" rel="nofollow noreferrer">https://jsfiddle.net/j6tv52s6/</a></p>
  
  <p>How can i do the prefill to the select ?</p>
  
  <p><img src="https://i.stack.imgur.com/5mgn9.png" alt="enter image description here"></p>
  
  <p>Here is my [Fiddle][2]</p>
  
  <p>Here is the HTML</p>
  
  <pre><code>&lt;input type="hidden" name='zipcode_covered' id='zipcodeCollection' value=""&gt;
  &lt;select class="js-data-example-ajax" style="width:100%" multiple="multiple" placeholder='Pincode'&gt;&lt;/select&gt;
  </code></pre>
  
  <p>Here is the Script :</p>
  
  <pre><code>function formatRepo(repo) {
    if (repo.loading) return repo.text;
    var markup = '&lt;div class="clearfix"&gt;' +
                 '&lt;div clas="col-sm-10"&gt;' +
                 '&lt;div class="clearfix"&gt;' +
                 '&lt;div class="col-sm-6"&gt;' + repo.zipcode + '&lt;/div&gt;' +
                 '&lt;/div&gt;'
    markup += '&lt;/div&gt;&lt;/div&gt;';
    return markup;
  }
  
  function formatRepoSelection(repo) {
    var cur_val = $('#zipcodeCollection').val();
    if (cur_val) {
      $('#zipcodeCollection').val(cur_val + "," + repo.zipcode);
    } else {
      $('#zipcodeCollection').val(repo.zipcode);
    } 
    return repo.zipcode;
  }
  
  $(document).ready(function(){
    $(".js-data-example-ajax").select2({
      ajax: {
        url: "getZipList",
        type: "POST",
        contentType: "application/json; charset=utf-8",
        delay: 250,
        data: function(params) {
          return {
            q: params.term, // search term
            page: params.page
          };
        },
        processResults: function (data, page) {
          return {
            results: data.items
          };
        },
        cache: true
      },
      escapeMarkup: function(markup) { return markup; }, // let our custom formatter work
      minimumInputLength: 1,
      templateResult: formatRepo, // omitted for brevity, see the source of this page
      templateSelection: formatRepoSelection // omitted for brevity, see the source of this page  
    });
  });
  </code></pre>