var setting = {
view: {
selectedMulti: false
},
check: {
enable: true,
chkStyle: "checkbox",
chkboxType: { "Y": "s", "N": "ps" }
},
data: {
simpleData: {
enable: true
}
},
callback: {
beforeCheck: zTreeBeforeCheck,
onCheck: zTreeOnCheck,
onRightClick: onRightClick
}
};
假如要修改setting配置中得chkboxType,若直接操控setting修改是无效得
错误操作:
setting.check.chkboxType={ "Y": "", "N": "" }
正确操作方法:
let treeObj = $.fn.zTree.getZTreeObj("treeDemo");
treeObj.setting.check.chkboxType = { "Y" : "", "N" : "" };