标签:== cte code style find color get hang tree
1 $("#reversecheckallmachines").on("change", function () { 2 var checkedNodes = []; 3 var uncheckedNodes = []; 4 5 var nodes = $tree.jstree("get_json", null, { flat: true }); 6 for (var i = 0; i < nodes.length; i++) { 7 if (nodes[i].state.selected) { 8 var findNode = nodes.find(x => x.parent === nodes[i].id); 9 if (!findNode) { 10 checkedNodes.push(nodes[i]); 11 } 12 } 13 else { 14 var fnode = nodes.find(x => x.parent === nodes[i].id); 15 if (!fnode) { 16 uncheckedNodes.push(nodes[i]); 17 } 18 } 19 } 20 $tree.jstree("uncheck_node", checkedNodes); 21 $tree.jstree("check_node", uncheckedNodes); 22 });
标签:== cte code style find color get hang tree
原文地址:https://www.cnblogs.com/Newd/p/12900561.html