obj =["34", "3", "34#add"] 數組,id 與樹形的所有id 一致 ...
//回顯選擇的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 一致