I have no idea what is wrong, and I can't find an answer anywhere:
The following works great, IF there are results:
jQuery("#last_name").select2({
ajax: {
url: "suggestions/",
dataType: 'json',
delay: 25,
data: function (params) {
return {
q: params.term, // search term
page:
params.page
};
},
processResults: function (data, page) {
return {
results: data.items
};
},
cache: false
},
language: {
noResults: function() {
return "No Results";
}
}
});
But if there are no results, then it's not doing what one would expect -- it just highlights the typed in term, with no "No Results" message.
Maybe I've got the ajax formatted wrong for zero results? It's currently showing:
{"items": []}
Any help is appreciated; I'm desperate to get this finished.