function initSet02(url,param,isCheck,isEdit) {
return {
async: {
enable: true,//开启异步加载
url:url,
type:"get",
autoParam:["id", "name", "level"],//参数名称可以写成"id=zId",那么后台接收参数为zId
contentType:"application/json",
otherParam:param,
dataFilter: filter//用于对 Ajax 返回数据进行预处理的函数
},
check: {
enable: isCheck,
chkStyle: "radio",
radioType: "all"
},
view: {
fontCss : {color:color},
showIcon: false,
addHoverDom: zTreeaddHoverDom,//用于当鼠标移动到节点上时,显示用户自定义控件
removeHoverDom: zTreeremoveHoverDom,//用于当鼠标移出节点时,隐藏用户自定义控件
selectedMulti: false//设置是否允许同时选中多个节点。
},
edit: {
drag:{
isCopy: false,
isMove: false
},
removeTitle: "删除节点",
renameTitle: "修改节点名称",
enable: isEdit//设置 zTree 是否处于编辑状态
},
data: {
simpleData: {
enable: true
}
},
callback: {
beforeRemove: zTreeBeforeRemove,
beforeRename: zTreeBeforeRename,
beforeCheck: zTreeBeforeCheck,
beforeClick: zTreeBeforeClick,
onAsyncSuccess:zTreeOnAsyncSuccess
}
};
}
/**公有知识点回调函数*/
function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getNodesByParamFuzzy("name", "*****", null);
for(var i=0;i<nodes.length;i++){
var node=nodes[i];
var name=node.name;
name=name.replace("*****","\'");
node.name=name;
//treeObj.editName(node);
treeObj.updateNode(node);
}
// alert(msg);
return {
async: {
enable: true,//开启异步加载
url:url,
type:"get",
autoParam:["id", "name", "level"],//参数名称可以写成"id=zId",那么后台接收参数为zId
contentType:"application/json",
otherParam:param,
dataFilter: filter//用于对 Ajax 返回数据进行预处理的函数
},
check: {
enable: isCheck,
chkStyle: "radio",
radioType: "all"
},
view: {
fontCss : {color:color},
showIcon: false,
addHoverDom: zTreeaddHoverDom,//用于当鼠标移动到节点上时,显示用户自定义控件
removeHoverDom: zTreeremoveHoverDom,//用于当鼠标移出节点时,隐藏用户自定义控件
selectedMulti: false//设置是否允许同时选中多个节点。
},
edit: {
drag:{
isCopy: false,
isMove: false
},
removeTitle: "删除节点",
renameTitle: "修改节点名称",
enable: isEdit//设置 zTree 是否处于编辑状态
},
data: {
simpleData: {
enable: true
}
},
callback: {
beforeRemove: zTreeBeforeRemove,
beforeRename: zTreeBeforeRename,
beforeCheck: zTreeBeforeCheck,
beforeClick: zTreeBeforeClick,
onAsyncSuccess:zTreeOnAsyncSuccess
}
};
}
/**公有知识点回调函数*/
function zTreeOnAsyncSuccess(event, treeId, treeNode, msg) {
var treeObj = $.fn.zTree.getZTreeObj(treeId);
var nodes = treeObj.getNodesByParamFuzzy("name", "*****", null);
for(var i=0;i<nodes.length;i++){
var node=nodes[i];
var name=node.name;
name=name.replace("*****","\'");
node.name=name;
//treeObj.editName(node);
treeObj.updateNode(node);
}
// alert(msg);
};
修改鼠标点击节点提示信息 改变title的值
data: {
key:{
title:"code"
}