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] =?UTF-8?q?BI-58124=20fix:=20=E8=B0=83=E7=94=A8=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=9A=84populate=E4=B8=8D=E4=BC=9A=E5=88=B7=E6=96=B0?= =?UTF-8?q?=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 4745ece5a..07294aae5 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 671c25096..35435a625 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 b00eee3db..a953ba018 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 e5f60581c..6f78f79d9 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 2fe610401..6f9a6d326 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 () { }