【发布时间】:2018-08-09 22:09:28
【问题描述】:
我想使用 Select2 框模仿正文类型为纯文本(例如“从表中选择 *”)的 URL 的帖子,但是我在哪里定义要发布的正文?
$("#sales_ids").select2({
placeholder: "Select your Partners",
multiple: 'multiple',
ajax: {
url: 'http://www.google.com/,
dataType: 'json',
type: 'post',
multiple: 'multiple',
allowclear: 'true',
processResults: function p(data){
var mapped = $.map(data, function(obj) {
obj.text = obj.text || obj.name;
obj.id = obj.id || obj.salesId;
return obj;
})
return {
results: mapped
}
【问题讨论】:
标签: drop-down-menu jquery-selectors jquery-select2