From 5b901d9a2a22de68623e44abeb25bbb19168113c Mon Sep 17 00:00:00 2001 From: fay Date: Wed, 26 Sep 2018 19:40:59 +0800 Subject: [PATCH] update --- .../combo.textvaluedownlist.js | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js index f075a3ec9..734395889 100644 --- a/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js +++ b/src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js @@ -20,7 +20,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { this._createValueMap(); var value; - if(BI.isNotNull(o.value)){ + if(BI.isNotNull(o.value)) { value = this._digest(o.value); } this.trigger = BI.createWidget({ @@ -44,13 +44,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }); this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { - self.setValue(self.combo.getValue()[0].value); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].value; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { - self.setValue(self.combo.getValue()[0].childValue); - self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + var currentVal = self.combo.getValue()[0].childValue; + if (currentVal !== self.value) { + self.setValue(currentVal); + self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); + } }); }, @@ -69,6 +75,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, { }, _digest: function (v) { + this.value = v; return this.valueMap[v]; },