I want to remove Select2 messages:
Follow the code below:
Html Page
<input id="ajaxSecretaria" type="hidden" style="width:300px" />
Script:
$(function () {
$('#ajaxSecretaria').select2(
{ minimumResultsForSearch: -1,
ajax: {
url: '@Url.Action("GetSecretarias", "Home")',
dataType: 'json',
data: function (term, page) {
return { searchTerm: term };
},
results: function (data, page) {
return {results: data};
}
}
});
});