This topic contains 1 reply, has 2 voices, and was last updated by Sean Sean 3 years, 7 months ago.

How to use remote date by select2

  • sulgraphica

    Posts: 4
    Member Reply #4122

    Hi I am attempting to do an AJAX call with the Select2 ver4 jquery plugin and Using Loading remote data of Select2. But i got an errot and took a screenshot. Please help me.

    html.code (components_select2.html)

    <select class="js-data-example-ajax2">
     <option selected="selected" value="3620194">select2/select2</option>

    js.code (components-select2.js)

     width: "off",
      ajax: {
       url: "./json.php",
       dataType: 'json',
       delay: 250,
       data: function(params) {
        return {
         q: params.term, // search term
       processResults: function(data, page) {
        // parse the results into the format expected by Select2.
        // since we are using custom formatting functions we do not need to
        // alter the remote JSON data
        return {
         results: data.items
       cache: true
    • This topic was modified 3 years, 7 months ago by  sulgraphica.
    • This topic was modified 3 years, 7 months ago by  sulgraphica.
    You must be logged in to view attached files.

    Posts: 4527
    Support Staff Reply #4134


    Sorry, our support does not cover 3rd party plugins. You can check select2 plugin’s official documentation in order to learn more:



You must be logged in to reply to this topic.