//回显选择的checkbox函数 function treeHxIdFun(obj) { var objTree = $.fn.zTree.init($("#demo"), setting, nodes); var zTreeObj = $.fn.zTree.getZTreeObj("demo"); var zTree = objTree.getCheckedNodes(false); for(var i = 0; i < obj.length; i++){ zTreeObj.checkNode(zTreeObj.getNodeByParam("id", obj[i])); zTreeObj.selectNode(zTreeObj.getNodeByParam("id", obj[i])); }; };
obj =["34", "3", "34#add"] 数组,id 与树形的所有id 一致