FineUI 官方论坛

标题: 级联下拉树选择框遇见的问题 [打印本页]

作者: Meiam    时间: 2017-8-4 17:35
标题: 级联下拉树选择框遇见的问题
首先先上代码

[attach]10418[/attach]

[attach]10419[/attach]

[attach]10420[/attach]


Alert.Show(JsonConvert.SerializeObject(deptsList.ToArray()));

输出

  1. [{"Selected":false,"Text":"--根节点--","Display":"","Group":"","Value":"-1","EnableSelect":true,"SimulateTreeLevel":0},{"Selected":false,"Text":"人管中心","Display":"","Group":"","Value":"1","EnableSelect":true,"SimulateTreeLevel":1},{"Selected":false,"Text":"行政部","Display":"","Group":"","Value":"2","EnableSelect":true,"SimulateTreeLevel":2},{"Selected":false,"Text":"财务部","Display":"","Group":"","Value":"8","EnableSelect":true,"SimulateTreeLevel":1},{"Selected":false,"Text":"信息部","Display":"","Group":"","Value":"9","EnableSelect":true,"SimulateTreeLevel":2},{"Selected":false,"Text":"资金部","Display":"","Group":"","Value":"10","EnableSelect":true,"SimulateTreeLevel":2}]
复制代码


UIHelper.DropDownList("DeptsID").LoadData(deptsList.ToArray());

控制台显示

  1. F.ui.DeptsID.loadData([["-1","--根节点--",1,"",""],["1","人管中心",1,"",""],["2","行政部",1,"",""],["8","财务部",1,"",""],["9","信息部",1,"",""],["10","资金部",1,"",""]]);F.ui.DeptsID.setValue('-1');
复制代码
为什么 loadData 的时候没有 EnableSelect 和 SimulateTreeLevel 的属性









作者: Meiam    时间: 2017-8-5 09:32
已解决

  1.             UIHelper.DropDownList("DeptsID").Source.EnableSimulateTree = true;
  2.             UIHelper.DropDownList("DeptsID").Source.DataSimulateTreeLevelField = "TreeLevel";
  3.             UIHelper.DropDownList("DeptsID").Source.DataEnableSelectField = "Enabled";
  4.             UIHelper.DropDownList("DeptsID").DataSource(ResolveDDL<Dept>(DeptHelper.Depts.Where(o => o.CompanyID == companyID).ToList()).ToArray(), "ID", "Name");
复制代码





欢迎光临 FineUI 官方论坛 (https://fineui.com/bbs/) Powered by Discuz! X3.4