WTM_LayUI 二級聯動
阿新 • • 發佈:2018-06-20
頁面 tro del text mod new ets 方法 style
cshtml頁面:
1 <wt:combobox field="Entity.ServicenameCodeID" items="AllServicenameCodes" link-field="@Model.AllshippingmethodsID" trigger-url="/ChannelApiInfor/GetServicenameIDByshippingmethod" /> 2 <wt:combobox field="@Model.AllshippingmethodsID" items="Allshippingmethods" multi-select="true"/>
控制器方法:
1 [ActionDescription("級聯")] 2 public IActionResult GetServicenameIDByshippingmethod(Guid id) 3 { 4 var vm= DC.Set<ShippingMethod>().Where(c => c.ServicenameCodeID == id).Select(m=> new { Text=m.cnname,Value=m.ID}).ToList(); 5 6 returnJson(vm); 7 }
另外可以參照一下圖片:
WTM_LayUI 二級聯動