From 2d3fb04edec048cca7cc797cdb59746bba66035f Mon Sep 17 00:00:00 2001 From: imp Date: Wed, 8 Jun 2022 17:22:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E5=86=99?= =?UTF-8?q?=E6=B3=95=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/widget/downlist/combo.downlist.js | 40 +++++++++++++++------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/src/widget/downlist/combo.downlist.js b/src/widget/downlist/combo.downlist.js index 3895ff6b8..4919e8327 100644 --- a/src/widget/downlist/combo.downlist.js +++ b/src/widget/downlist/combo.downlist.js @@ -22,23 +22,6 @@ BI.DownListCombo = BI.inherit(BI.Widget, { _init: function () { BI.DownListCombo.superclass._init.apply(this, arguments); var self = this, o = this.options; - this.popupview = BI.createWidget({ - type: "bi.down_list_popup", - items: o.items, - chooseType: o.chooseType, - value: o.value - }); - - this.popupview.on(BI.DownListPopup.EVENT_CHANGE, function (value) { - self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); - self.downlistcombo.hideView(); - }); - - this.popupview.on(BI.DownListPopup.EVENT_SON_VALUE_CHANGE, function (value, fatherValue) { - self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); - self.downlistcombo.hideView(); - }); - this.downlistcombo = BI.createWidget({ element: this, @@ -58,7 +41,28 @@ BI.DownListCombo = BI.inherit(BI.Widget, { height: o.height }), popup: { - el: this.popupview, + el: { + type: "bi.down_list_popup", + ref: function (ref) { + self.popupView = ref; + }, + items: o.items, + chooseType: o.chooseType, + value: o.value, + listeners: [{ + eventName: BI.DownListPopup.EVENT_CHANGE, + action: function (value) { + self.fireEvent(BI.DownListCombo.EVENT_CHANGE, value); + self.downlistcombo.hideView(); + } + }, { + eventName: BI.DownListPopup.EVENT_SON_VALUE_CHANGE, + action: function (value, fatherValue) { + self.fireEvent(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, value, fatherValue); + self.downlistcombo.hideView(); + } + }] + }, stopPropagation: o.stopPropagation, maxHeight: o.maxHeight, minWidth: o.minWidth