Here is what the json string looks like that gets returned from my coldfusion page: [{"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 everything is working perfectly but none of the data shows up in the select2 plugin.
Does anyone know what the problem might be? Should it be returning column names or something?
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 };
}
}
});
[{"text":"Asante","id":12}, ...]
else you need to pass{results: data, text: 'client'}
– Foresail