How to add a image next to a list item in ajax combobox
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Dharani dharanRank #4,788 · 325 reputationPosted Mar 12, 2014, 9:50 PM EDT
http://www.telerik.com/help/aspnet-ajax/combobox-appearance-item-images.html
https://demos.devexpress.com/ASPxEditorsDemos/ASPxComboBox/ImageEditBox.aspx
Please refer the above links it will help u.
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Mar 13, 2014, 1:53 AM EDT
You can use http://brianreavis.github.io/selectize.js/.
$('#select-movie').selectize({
valueField: 'title',
labelField: 'title',
searchField: 'title',
options: [],
create: false,
render: {
option: function(item, escape) {
var actors = [];
for (var i = 0, n = item.abridged_cast.length; i < n; i++) {
actors.push('' + escape(item.abridged_cast[i].name) + '');
}
return '
'
'' +
'' + escape(item.title) + '' +
'' +
'' + escape(item.synopsis || 'No synopsis available at this time.') + '' +
'' + (actors.length ? 'Starring ' + actors.join(', ') : 'Actors unavailable') + '' +
'
}
},
load: function(query, callback) {
if (!query.length) return callback();
$.ajax({
url: 'http://api.rottentomatoes.com/api/public/v1.0/movies.json',
type: 'GET',
dataType: 'jsonp',
data: {
q: query,
page_limit: 10,
apikey: '3qqmdwbuswut94jv4eua3j85'
},
error: function() {
callback();
},
success: function(res) {
callback(res.movies);
}
});
}
});