z-tree获取当前点击节点遍历父节并赋值

it2024-10-31  9

callback: { onClick:function (event, treeId, treeNode) { switch (treeNode.level) { case 0: $('#compInfoId').val(treeNode.id); break; case 1: $('#deptId').val(treeNode.id); break; case 2: $('#postId').val(treeNode.id); break; } formYk.render(); while (treeNode.getParentNode()!=undefined){ treeNode=treeNode.getParentNode(); switch (treeNode.level) { case 0: $('#compInfoId').val(treeNode.id); break; case 1: $('#deptId').val(treeNode.id); break; case 2: $('#postId').val(treeNode.id); break; } formYk.render(); } } }

 

最新回复(0)