Forum

Select2 nie pokazuj...
 
Notifications
Clear all

Select2 nie pokazuje ajaxowych wyników w jsonie

1 Posty
1 Users
0 Likes
7,513 Widok
0
Topic starter

Select2 nie pokazuje ajaxowych wyników w jsonie

1 Answer
0
Topic starter

Select2 wymaga zmiennej text jakoś uchwytu wyszukiwania oraz unikatowego id

  $("#e6").select2({
 width:"resolve",
 placeholder: "Search for a movie",
 minimumInputLength: 3,
 id: function(uczen){ return uczen._id; },
 ajax: { // instead of writing the function to execute the request we use Select2's convenient helper
 url: "uczen/ajax_get",
 dataType: 'json',
 type: "POST",
 data: function (term, page) {
 return {
 q: term, // search term
 page_limit: 10
 };
 },
 results: function (data, page) {
 return {results: data };
 }
 },
 formatResult: movieFormatResult,
 formatSelection: movieFormatSelection,
 dropdownCssClass: "bigdrop",
 escapeMarkup: function (m) { return m; }
 });

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: