fay 6 years ago
parent
commit
85d730d79d
  1. 16
      src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js

16
src/case/combo/textvaluedownlistcombo/combo.textvaluedownlist.js

@ -21,6 +21,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
var value; var value;
if(BI.isNotNull(o.value)){ if(BI.isNotNull(o.value)){
this.value = o.value;
value = this._digest(o.value); value = this._digest(o.value);
} }
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
@ -44,13 +45,19 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
}); });
this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () { this.combo.on(BI.DownListCombo.EVENT_CHANGE, function () {
self.setValue(self.combo.getValue()[0].value); var currentVal = self.combo.getValue()[0].value;
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
}); });
this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () { this.combo.on(BI.DownListCombo.EVENT_SON_VALUE_CHANGE, function () {
self.setValue(self.combo.getValue()[0].childValue); var currentVal = self.combo.getValue()[0].childValue;
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE); if (currentVal !== self.value) {
self.setValue(currentVal);
self.fireEvent(BI.TextValueDownListCombo.EVENT_CHANGE);
}
}); });
}, },
@ -69,6 +76,7 @@ BI.TextValueDownListCombo = BI.inherit(BI.Widget, {
}, },
_digest: function (v) { _digest: function (v) {
this.value = v;
return this.valueMap[v]; return this.valueMap[v];
}, },

Loading…
Cancel
Save