From d2a7ca5614c1e5d7ffbbea7b8973bc8e9e825a3f Mon Sep 17 00:00:00 2001 From: "DESKTOP-QVKS9CG\\Young" Date: Mon, 5 Jun 2017 16:50:36 +0800 Subject: [PATCH] tree --- bi/base.js | 10 ++++++++++ bi/widget.js | 4 +--- docs/base.js | 10 ++++++++++ docs/widget.js | 4 +--- src/base/tree/treeview.js | 10 ++++++++++ src/widget/multiselecttree/multiselecttree.js | 4 +--- 6 files changed, 33 insertions(+), 9 deletions(-) diff --git a/bi/base.js b/bi/base.js index 947c621acb..525841fd92 100644 --- a/bi/base.js +++ b/bi/base.js @@ -1937,6 +1937,16 @@ BI.TreeView = BI.inherit(BI.Pane, { }, checkAll: function (checked) { + function setNode(children) { + BI.each(children, function (i, child) { + child.halfCheck = false; + setNode(child.children); + }); + } + BI.each(this.nodes.getNodes(), function (i, node) { + node.halfCheck = false; + setNode(node.children); + }); this.nodes && this.nodes.checkAllNodes(checked); }, diff --git a/bi/widget.js b/bi/widget.js index f4a98a86b8..39789204c0 100644 --- a/bi/widget.js +++ b/bi/widget.js @@ -11442,9 +11442,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setValue: function (v) { - this.adapter.setValue({ - value: v || {} - }); + this.adapter.setValue(v); }, stopSearch: function () { diff --git a/docs/base.js b/docs/base.js index 947c621acb..525841fd92 100644 --- a/docs/base.js +++ b/docs/base.js @@ -1937,6 +1937,16 @@ BI.TreeView = BI.inherit(BI.Pane, { }, checkAll: function (checked) { + function setNode(children) { + BI.each(children, function (i, child) { + child.halfCheck = false; + setNode(child.children); + }); + } + BI.each(this.nodes.getNodes(), function (i, node) { + node.halfCheck = false; + setNode(node.children); + }); this.nodes && this.nodes.checkAllNodes(checked); }, diff --git a/docs/widget.js b/docs/widget.js index f4a98a86b8..39789204c0 100644 --- a/docs/widget.js +++ b/docs/widget.js @@ -11442,9 +11442,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setValue: function (v) { - this.adapter.setValue({ - value: v || {} - }); + this.adapter.setValue(v); }, stopSearch: function () { diff --git a/src/base/tree/treeview.js b/src/base/tree/treeview.js index 4e74c9967e..6ada95083e 100644 --- a/src/base/tree/treeview.js +++ b/src/base/tree/treeview.js @@ -436,6 +436,16 @@ BI.TreeView = BI.inherit(BI.Pane, { }, checkAll: function (checked) { + function setNode(children) { + BI.each(children, function (i, child) { + child.halfCheck = false; + setNode(child.children); + }); + } + BI.each(this.nodes.getNodes(), function (i, node) { + node.halfCheck = false; + setNode(node.children); + }); this.nodes && this.nodes.checkAllNodes(checked); }, diff --git a/src/widget/multiselecttree/multiselecttree.js b/src/widget/multiselecttree/multiselecttree.js index f51bdca39a..54653c10ff 100644 --- a/src/widget/multiselecttree/multiselecttree.js +++ b/src/widget/multiselecttree/multiselecttree.js @@ -139,9 +139,7 @@ BI.MultiSelectTree = BI.inherit(BI.Widget, { }, setValue: function (v) { - this.adapter.setValue({ - value: v || {} - }); + this.adapter.setValue(v); }, stopSearch: function () {