这是从我的coldfusion页面返回的json字符串的样子[{"client":"Asante","id":12},{"client":"City of Lancaster","id":14},{"client":"Massey Energy","id":35},{"client":"Northeast Utilities","id":68},{"client":"Washtenaw","id":50}]
:Firebug 声称一切正常,但 select2 插件中没有显示任何数据。
有谁知道问题可能是什么?它应该返回列名还是什么?
select2 调用:
$(".select").select2({
allowClear: true,
blurOnChange: true,
openOnEnter: false,
ajax: {
url: "/surveymanagement/admin/client.cfc",
dataType: 'json',
data: function (term, page) {
return {
method: "GetClientsByName",
name: term
};
},
results: function (data, page) {
return { results: data };
}
}
});