These two days to do the project need to use the multi-select control, so chose the jquery MultiSelect control, introduce some common related properties.
Detailed Address: Http://davidstutz.github.io/bootstrap-multiselect
To add a reference:
Page:
<divclass="Mui-input-row"> <spanclass="Mui-icon mui-icon-contact mui-pull-right"></span> <label style="color: #8f8f94; font-size:15px!important"> People </label> <SelectId="example-getting-started"multiple="multiple">@foreach (varEmpinch(list<selectlistitem>) {viewbag.unemplist) {<option value="@emp. Value"> @emp. Text</option> } </Select></div>
Js:
$ (document). Ready (function () {$ ('#example-getting-started'). MultiSelect ({nonselectedtext:'Please select a tracker',//defaultFilterplaceholder:'Search',//Display in search boxNselectedtext:'bit Tracker', enablefiltering:true, Includeselectalloption:true,//is it a self-couplingSelectalltext:'Select All/No', Allselectedtext:'all people are selected', MaxHeight: -,//Maximum HeightDropup:true,//whether the control is searching upwards }); //The value is used directly with. val () to get multiple selected values varresult = $ ('#example-getting-started'). Val (); //Set Default value note format varids = [1,2,3,4,5]; $('#example-getting-started'). Val (IDs); $('#example-getting-started'). MultiSelect ("Refresh"); });
:
JQuery MultiSelect related uses