From 8c3b50b19ed2fc6c1a3cf22db2b4f8342ffb7220 Mon Sep 17 00:00:00 2001 From: zsmj Date: Fri, 4 Nov 2022 15:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0JIRA=20=20fix:=20bi.text=5Fvalue=5Fdow?= =?UTF-8?q?n=5Flist=5Fcombo=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo.textvaluedownlist.js | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js index 9410d9190..956e18552 100644 --- a/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/widget/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -19,14 +19,6 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { if(BI.isNotNull(o.value)) { value = this._digest(o.value); } - this.trigger = BI.createWidget({ - type: "bi.down_list_select_text_trigger", - cls: "text-value-down-list-trigger", - height: BI.toPix(o.height, 2), - items: o.items, - text: o.text, - value: value - }); this.combo = BI.createWidget({ type: "bi.down_list_combo", @@ -35,7 +27,17 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { adjustLength: 2, width: BI.toPix(o.width, 2), height: BI.toPix(o.height, 2), - el: this.trigger, + el: { + type: "bi.down_list_select_text_trigger", + ref: function (_ref) { + self.trigger = _ref; + }, + cls: "text-value-down-list-trigger", + height: BI.toPix(o.height, 2), + items: o.items, + text: o.text, + value: value + }, value: BI.isNull(value) ? [] : [value], items: BI.deepClone(o.items) }); @@ -79,7 +81,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { setValue: function (v) { v = this._digest(v); this.combo.setValue([v]); - this.trigger.setValue(v); + this.trigger?.setValue(v); }, getValue: function () { @@ -94,4 +96,4 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { } }); BI.TextValueDownListCombo.EVENT_CHANGE = "EVENT_CHANGE"; -BI.shortcut("bi.text_value_down_list_combo", BI.TextValueDownListCombo); \ No newline at end of file +BI.shortcut("bi.text_value_down_list_combo", BI.TextValueDownListCombo);