javascript - Select2 save current list and values .. -
i using select2.js widget site drop-down selection of long list here
i have use ajax loading option ..but when open/click drop-down looses old search text + loaded list , star new .. don't want that.. wanted keep old search text if there if list loaded wanted keep , new @ end of scroll ...
code same in select2 example fiddle test
var $ajax = $(".js-example-data-ajax"); $ajax.select2({ ajax: { url: "https://api.github.com/search/repositories", datatype: 'json', delay: 250, data: function (params) { return { q: params.term?params.term:"a", // search term page: params.page }; }, processresults: function (data, params) { params.page = params.page || 1; return { results: data.items, pagination: { more: (params.page * 30) < data.total_count } }; }, cache: true }, escapemarkup: function (markup) { return markup; }, minimuminputlength: 0, templateresult: formatrepo, templateselection: formatreposelection });
any stop stop start search on open , keep old test , list saved user can keep looking next search after 1 selection
Comments
Post a Comment