
Рабочий пример: http://jsfiddle.net/byJy8/1/
код:
×
Panel
Numer
Close
Save changes
JS
$("#vdn_number").select2({
placeholder: "00000",
minimumInputLength: 2,
ajax: {
url: "getAjaxData/",
dataType: 'json',
type: "POST",
data: function (term, page) {
return {
q: term, // search term
col: 'vdn'
};
},
results: function (data) { // parse the results into the format expected by Select2.
// since we are using custom formatting functions we do not need to alter remote JSON data
return {results: data};
}
}
});
Подробнее здесь: https://stackoverflow.com/questions/184 ... trap-modal
Мобильная версия