I have a Select2 Multiselect html element. While rendering the placeholder is not displaying, but if I select and remove the item, the placeholder is displaying. I have no idea how to make it work. Please advise.
Initially
While Selection
After removing the items
Code:
@Html.DropDownListFor(m => m.Vendor, new SelectList(Model.Status), "Search Status", new { @id = "advanced-search-lsc-status", @class = "form-control", @multiple = "multiple", data_placeholder = "Select Status" })
$('#advanced-search-status').select2({
minimumResultsForSearch: -1,
placeholder: function(){
$(this).data('placeholder');
},
width: '100%'
});