效果图:
function loadCombxTree() { $('#CompanyId').combotree({ url: '/admin/CompanyAdmin/Hanlder/CompanyService.ashx?function=getCompanyComboxTreeList', animate: true, loadFilter: function (rows) { return convert3(rows); }, lines: true, dataPlain: true,//该属性用以启用当前 easyui-tree 控件对平滑数据格式的支持 toggleOnClick: false, checkbox: true, enableContextMenu: false, onClick: function (node) { $("#CompanyId").combotree("setText", node.text); $('#CompanyId').combotree("hidePanel"); $("#OrgName").val(node.text); }, }); }
ashx返回的数据是JSON形式
<script src="/resources/js/treeJs/Node.js"></script>
<script src="/resources/js/treeJs/Tree.js"></script>
<script src="/resources/js/treeJs/treeFunction.js"></script>
<script src="/resources/js/bootstrap/dataTables2/jquery.dataTables.min.js"></script>