From cd9e5e8361c6446f8763f52b30618098a43226c0 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 7 Jan 2020 12:39:28 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-58124=20fix:=20=E8=B0=83=E7=94=A8?= =?UTF-8?q?=E6=8E=A7=E4=BB=B6=E7=9A=84populate=E4=B8=8D=E4=BC=9A=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E5=8F=B3=E4=B8=8A=E8=A7=92=E8=AE=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/multiselect/multiselect.combo.js | 1 + .../multiselect/multiselect.combo.nobar.js | 1 + .../multiselect/multiselect.insert.combo.js | 1 + .../multiselect.insert.combo.nobar.js | 1 + .../trigger/button.checkselected.js | 22 +++++++++++++++---- 5 files changed, 22 insertions(+), 4 deletions(-) diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 4745ece5a3..07294aae5b 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -424,6 +424,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate.apply(this.combo, arguments); + this.numberCounter.populate.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index 671c250965..35435a6250 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -420,6 +420,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate.apply(this.combo, arguments); + this.numberCounter.populate.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index b00eee3db3..a953ba0188 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -441,6 +441,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate.apply(this.combo, arguments); + this.numberCounter.populate.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index e5f60581c3..6f78f79d9d 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -438,6 +438,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { populate: function () { this.combo.populate.apply(this.combo, arguments); + this.numberCounter.populate.apply(this.numberCounter, arguments); } }); diff --git a/src/widget/multiselect/trigger/button.checkselected.js b/src/widget/multiselect/trigger/button.checkselected.js index 2fe6104015..6f9a6d3268 100644 --- a/src/widget/multiselect/trigger/button.checkselected.js +++ b/src/widget/multiselect/trigger/button.checkselected.js @@ -45,11 +45,8 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, { } }, - setValue: function (ob) { + _populate: function (ob) { var self = this, o = this.options; - ob || (ob = {}); - ob.type || (ob.type = BI.Selection.Multi); - ob.value || (ob.value = []); if (ob.type === BI.Selection.All) { o.itemsCreator({ type: BI.MultiSelectCombo.REQ_GET_DATA_LENGTH @@ -68,6 +65,23 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, { }); }, + _assertValue: function (ob) { + ob || (ob = {}); + ob.type || (ob.type = BI.Selection.Multi); + ob.value || (ob.value = []); + return ob; + }, + + setValue: function (ob) { + ob = this._assertValue(ob); + this.options.value = ob; + this._populate(ob); + }, + + populate: function () { + this._populate(this.options.value); + }, + getValue: function () { } From 4c30241b8c2096a1844316e7ca7aa431bf1ff451 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Tue, 7 Jan 2020 13:42:06 +0800 Subject: [PATCH 2/2] update --- src/widget/multiselect/trigger/button.checkselected.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widget/multiselect/trigger/button.checkselected.js b/src/widget/multiselect/trigger/button.checkselected.js index 6f9a6d3268..15d302a323 100644 --- a/src/widget/multiselect/trigger/button.checkselected.js +++ b/src/widget/multiselect/trigger/button.checkselected.js @@ -79,7 +79,7 @@ BI.MultiSelectCheckSelectedButton = BI.inherit(BI.Single, { }, populate: function () { - this._populate(this.options.value); + this._populate(this._assertValue(this.options.value)); }, getValue: function () {