I am using a jquery multi select for a drop down in order to give user an opportunity to select multiple items from a drop down
Html Code:
<div class="jobdiv">
<img src="~/Images/traj.png" width="22" height="24" />
@Html.DropDownListFor(model => Model.TrajName, @Model.Traj,
new { @class = "jobdrpdown", id = "drpTraj", onchange = "GetSelectedTraj(this.value); ", multiple = "multiple" })
</div>
The styles are defined as below :
.jobdiv {
margin-right: 15px;
margin-left: 15px;
padding-bottom: 12px;
}
.jobdropdown {
width: 194px;
font-size: 13px;
font-family: Arial;
margin-right: 5px;
height: 24px;
}
In $(document).ready(function ()
:
$(document).ready(function () {
$('#drpTraj').multiselect({
nonSelectedText: 'Select items below',
width : 180,
minWidth : 180
});
}
My issue is I am unable to set the width of the dropdown. I am using the same style for several components.
But the jquery multiselect alone doesn't get the width property. See image below :
Also when I select few items, the selected text goes out of the specified width. See image below :
If I am using a normal dropdown it works fine in this case. Thanks in advance for any valuable suggestions.