I\'m having an issue when getting json results back to select2. My json does not return a result that has a \"text\" field so need to format the result so that select2 accepts \
note that select2 is always in {id,text} pair so you need to specify both
results: function (data, page) {
var newData = [];
_.each(data, function (item) {
newData.push({
id: item.Id //id part present in data
, text: item.DisplayString //string to be displayed
});
});
return { results: newData };
}
},