I think I am missing something here.
Select2 is working fine in my MVC application, except, it is not showing dropdown image, search image, clear image, or I should say any other image which is a part of this plugin.
Following is how I have used it in my page:
1) Razor view
<div> <input id="countriesList" type="hidden" class="bigdrop"/> </div>
2) Script
$('#countriesList').select2(
{
placeholder: 'Select Countries',
minimumInputLength: 0,
maximumSelectionSize: 3,
multiple: true,
allowClear:true,
ajax: {
url: '@Url.Action("GetCountriesList", "Geography")',
dataType: 'json',
data: function (term, page) {
return {
searchTerm: term
};
},
results: function (data, page) {
return {
results: data
};
}
}
});
Also, I have copied select2 files (i.e. js, css, images, and all) in the same folder structure as they were downloaded from its site, and I can see CSS and JS being loaded as well. It seems I am not using appropriate classes due to which images are not getting loaded.