Notifications
Clear all
BugOverflow
1
Posty
1
Users
0
Reactions
8,066
Widok
0
30/07/2015 9:20 pm
Topic starter
Select2 nie pokazuje ajaxowych wyników w jsonie
1 Answer
0
30/07/2015 9:20 pm
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; } });