Filtering AJAX response with another AJAX request

23 views
Skip to first unread message

Mirma H

unread,
Jan 9, 2017, 7:45:39 AM1/9/17
to select2
Hi guys,

i'm new to JS and got select2 in my new project and at the moment I have code like this which works just fine:

  $("#group-search").select2({
    ajax
: {
      url
: "groups.search",
      dataType
: 'jsonp',
      data
: function (term, page) {
       
return {
          q
: term,
          access_token
: access_token
       
};
     
},
      results
: function (data, page) {
       
return { results: data.response.items };
     
}
   
}
 
});

but I need to filter my results (data) with the help of another AJAX-request. Is it possible to achieve somehow?


Reply all
Reply to author
Forward
0 new messages