前端:
$(function () { var nodeAll = "000"; $('#departmentTree').tree({ url: 'getDepartment.ashx', onClick: function (node) { //$(this).tree('toggle', node.target); $("#hidSelectednodeId").val(node.id); $("#btnQuery").click(); }, onBeforeExpand: function (node) { $(this).tree('options').url = 'getDepartment.ashx?depid=' + node.id; return true; } }); });
<ul id="departmentTree" class="ztree"> </ul>