123456789101112131415161718192021222324252627282930313233343536373839 |
- var checkedIds = [];
- var checkedNoteName = [];
- function getNodes() {
- var nodes = $("#itemTree").getTSNs(true);//获取所有勾选节点包括半勾选
-
- $.each(nodes, function (i, value) {
- var id = value.id;
- checkedIds.push(id);
- });
- }
- //被选中元素的ID,TEXT 数组维护
- function GetAllCheckNodes(id, status, text) {
- //数据加入数组
- if (status == 1) {
- if (!checkedIds.contain(id)) {
- checkedIds.push(id);
- }
- if (!checkedNoteName.contain(text)) {
- checkedNoteName.push(text);
- }
- }
- if (status == 0) {
- if (checkedIds.contain(id)) {
- checkedIds.splice(checkedIds.indexOf(id), 1);
- }
- if (checkedNoteName.contain(text)) {
- checkedNoteName.splice(checkedNoteName.indexOf(text), 1);
- }
- }
- }
|