给zTree的treeNode添加class
onNodeCreated 回调,捕获 DOM 创建完毕的回调,然后利用 zTree 的规则找到 treeNode.tId + "_a" 这样的 标签,自行添加 class 就是了
function zTreeOnNodeCreated(event, treeId, treeNode) { console.log($('#'+treeNode.tId+'_edit'),treeNode.tId + ", " + treeNode.name,'#'+treeNode.tId+'_edit'); console.log($('#groupTree_1_span').next()); groupTree_1_edit }; // function zTreeOnMouseDown(event, treeId, treeNode) { console.log(treeNode ? treeNode.tId + ", " + treeNode.name : "isRoot"); console.log($('#groupTree_1_span').next()); $('#'+treeNode.tId+'_span').next().addClass("update"); $('#'+treeNode.tId+'_span').next().next().addClass("del"); };