jstree 反选,测试400条数据左右有点卡
2021-03-06 03:26
标签:== cte code style find color get hang tree jstree 反选,测试400条数据左右有点卡 标签:== cte code style find color get hang tree 原文地址:https://www.cnblogs.com/Newd/p/12900561.html 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 ) {
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 });