title: Listing with select2 ajax
body: <p>I am doing a select box listing with select2 ajax. I can list the data from the server but it is not listed in the selectbox. How can I solve this problem?</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;input type="hidden" class="js-data-example-ajax form-control" /&gt;
  </code></pre>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>$(".js-data-example-ajax").select2({
    minimumInputLength: 3,
    ajax: {
      url: "/Contacts/Test1",
      dataType: 'json',
      delay: 250,
      data: function (params) {
        return {
          "temp": params,
        };
      },                  
      results: function (data) {
        console.log(data)
        debugger;
        var parsed = [];
        try {
          parsed = $.map(data.data, function (item) {
            console.log(item)
            return {
              ID: item.ID,
              ADI: item.ADI
            }
          }).value();
  
        } catch (e) {
  
        }
        console.log(parsed);
        return {
          results: parsed
        };
      },
      cache: false
    }
  });
  </code></pre>