function onClick(e, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("sprTree")
var newNode = {name:"newNode1"}
newNode = treeObj.addNodes(treeNode, newNode)
}
// 异步返回后执行的函数可以这么写function(childNodes) {
var treeObj = $.fn.zTree.getZTreeObj("tree")// 传入参数为ul的id
var parentNode = treeObj.getNodeByParam("id", childNodes[0].pId)// 也可以用其他方式获得父节点
treeObj.addNodes(parentNode, childNodes)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)