/* 节点点击事件 */
function onClick(e, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo"),
nodes = zTree.getSelectedNodes(),
v = "";//存储组织名称
idd="";//存储组织ID
nodes.sort(function compare(a,b){return a.id-b.id;});
for (var i=0, l=nodes.length; i<l; i++) {
v += nodes[i].name + ",";
idd += nodes[i].id + ",";
}
if (v.length > 0 ) v = v.substring(0, v.length-1);
if (idd.length > 0 ) idd = idd.substring(0, idd.length-1);
$("#org").attr("idd", idd);
$("#org").attr("value", v);
hideMenu();
}
/* 成功后的回调函数 */
function onAsyncSuccess(event, treeId, treeNode, msg) {
var zTree = $.fn.zTree.getZTreeObj("treeDemo");
zTree.updateNode(treeNode);
/* 第一种方法 */
06-22
1861
05-26