function(childNodes) {
var treeObj = $.fn.zTree.getZTreeObj("tree")// 传入参数为ul的id
var parentNode = treeObj.getNodeByParam("id", childNodes[0].pId)// 也可以用其他方式获得父节点
treeObj.addNodes(parentNode, childNodes)
}
点击节点树时,对于 id = "sprTree" 的 zTree 增加 1 个子节点function onClick(e, treeId, treeNode) {
var zTree = $.fn.zTree.getZTreeObj("sprTree")
var newNode = {name:"newNode1"}
newNode = treeObj.addNodes(treeNode, newNode)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)