0
我使用的引導多選(https://davidstutz.github.io/bootstrap-multiselect/)如果選擇從一個組中的任何選項,然後在其他組中的所有選項應該開始使用多選自舉(optgroups)
我有2組的下拉菜單中禁用。
在頂層組中選擇任何選項後,第二組中的所有項目都應禁用。
我應該能夠從第二組中選擇任何選項。
我的控制器綁定數據,列表按照縣分類分組。 :
public void CHDSList()
{List<SelectList> CHDSListList = new List<SelectList>();
ViewData["CHDSList"] = new SelectList((from s in objentity.tbl_CountiesMst.ToList().OrderBy(a => a.County_Code)
select new
{
County_Code = s.County_Code,
County_Name = s.County_Code +" - " + s.County_Name,
County_category = s.County_Category
}), "County_Code", "County_Name", "county_category", 1);
}
在視圖中,我有這個...
$('.listbox').multiselect({
includeSelectAllOption: false,
buttonWidth: '100%',
maxHeight: 200,
enableClickableOptGroups: true })
@Html.ListBox("ChdListBox", (SelectList)(IEnumerable<SelectListItem>)ViewData["CHDSList"],
new { @class = "listbox", @style = "text-align:left; multiple=multiple;
width:100px;min-width:100%; height:30px; border-color:lightblue" })