Here's what looks like a string json, which is returned to my page coldfusion: [{"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 claims that everything works fine, but none of the data is displayed in the select2 plugin.
Does anyone know what the problem is? Should they return column names or something else?
select2 call:
$(".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 };
}
}
});
source
share