标签:temp name sel url post hold ram end --
$(‘#select_yx‘).select2({
placeholder: "----请选择院系----",
width: "183px",
allowClear: true,
language: {
noResults: function (params) { return "暂无数据"; }
},
minimumResultsForSearch: -1,
ajax: {
url: apiaddress + ‘/Institute/GetInstitutes‘,
dataType: ‘json‘,
method: ‘POST‘,
delay: 500,
data: function (params) {
var query = {
Name: params.term
};
return query;
},
beforeSend: function (xhr) {
xhr.setRequestHeader("Authorization", "Bearer " + vToken);
},
processResults: function (data, params) {
var results = [];
if (data != null) {
var tmp = data.result;
for (var i in tmp) {
var temp = tmp[i];
results.push({ id: temp.id, text: temp.name });
}
}
return {
results: results
};
}
}
});
标签:temp name sel url post hold ram end --
原文地址:https://www.cnblogs.com/Anthony518/p/11258499.html