<script type="text/javascript" src="/EasyUI/jquery.min.js"></script> <script type="text/javascript" src="/EasyUI/jquery.easyui.min.js"></script>
<select id="ddlyou" runat="server" class="easyui-combotree" style="width: 205px; height: 24px;"> </select>
只能是 id 与 text的固定组合
<%=ViewState["check"]%> 是数据来源
$(function () { $(‘#<%=ddlyou.ClientID%>‘).combotree({ valueField: "id", //Value字段 textField: "text", //Text字段 multiple: true, data: [{ "id": "0", "text": "All", "children": <%=ViewState["check"]%> }] ,
data: [{ "id": "0", "text": "All", "children": [{ "id": 13, "text": "C1" }, { "id": 14, "text": "C2" }, { "id": 15, "text": "C3"}]}] ,
//url: "tree_data2.json", //数据源 onCheck: function (node, checked) { //让全选不显示 $("#<%=ddlyou.ClientID%>").combotree("setText", $("#<%=ddlyou.ClientID%>").combobox("getText").toString().replace("全选,", "")); }, onClick: function (node, checked) { //让全选不显示 $("#<%=ddlyou.ClientID%>").combotree("setText", $("#<%=ddlyou.ClientID%>").combobox("getText").toString().replace("全选,", "")); } }); });
var youpin = document.getElementById("_easyui_textbox_input3").value; 选中的值 //_easyui_textbox_input3 替换成对应id