|
|
@ -85,11 +85,15 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
eventName: BI.TextValueComboPopup.EVENT_CHANGE, |
|
|
|
eventName: BI.TextValueComboPopup.EVENT_CHANGE, |
|
|
|
action: (...args) => { |
|
|
|
action: (...args) => { |
|
|
|
changeTag = true; |
|
|
|
changeTag = true; |
|
|
|
this.setValue(this.popup.getValue()); |
|
|
|
const value = this.popup.getValue(); |
|
|
|
|
|
|
|
this.setValue(value); |
|
|
|
if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) { |
|
|
|
if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_SINGLE) { |
|
|
|
this.combo.hideView(); |
|
|
|
this.combo.hideView(); |
|
|
|
this.fireEvent(BI.TextValueCombo.EVENT_CHANGE, ...args); |
|
|
|
this.fireEvent(BI.TextValueCombo.EVENT_CHANGE, ...args); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (o.chooseType === BI.ButtonGroup.CHOOSE_TYPE_MULTI && BI.isEmptyArray(value)) { |
|
|
|
|
|
|
|
this._clear(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
}, { |
|
|
|
eventName: BI.Controller.EVENT_CHANGE, |
|
|
|
eventName: BI.Controller.EVENT_CHANGE, |
|
|
@ -100,7 +104,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
eventName: BI.TextValueComboPopup.EVENT_CLEAR, |
|
|
|
eventName: BI.TextValueComboPopup.EVENT_CLEAR, |
|
|
|
action: (...args) => { |
|
|
|
action: (...args) => { |
|
|
|
changeTag = true; |
|
|
|
changeTag = true; |
|
|
|
this.setValue([]); |
|
|
|
this._clear(); |
|
|
|
this.combo.hideView(); |
|
|
|
this.combo.hideView(); |
|
|
|
} |
|
|
|
} |
|
|
|
}, { |
|
|
|
}, { |
|
|
@ -151,6 +155,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_clear: function () { |
|
|
|
_clear: function () { |
|
|
|
|
|
|
|
this.trigger.setText(""); |
|
|
|
this.combo.setValue(); |
|
|
|
this.combo.setValue(); |
|
|
|
this.setStatus("success"); |
|
|
|
this.setStatus("success"); |
|
|
|
}, |
|
|
|
}, |
|
|
@ -164,7 +169,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
|
|
|
|
|
|
|
|
var vals = BI.isArray(v) ? v : [v]; |
|
|
|
var vals = BI.isArray(v) ? v : [v]; |
|
|
|
|
|
|
|
|
|
|
|
var result = BI.intersection(BI.map(this.options.items, (i, item) => item.value), vals); |
|
|
|
var result = BI.intersection(BI.map(this.options.items, "value"), vals); |
|
|
|
|
|
|
|
|
|
|
|
if (result.length !== vals.length) { |
|
|
|
if (result.length !== vals.length) { |
|
|
|
this.setStatus("error"); |
|
|
|
this.setStatus("error"); |
|
|
@ -177,6 +182,10 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
this._clear(); |
|
|
|
this._clear(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
setText: function (text) { |
|
|
|
|
|
|
|
this.trigger.setText(text); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|
this.combo.setValue(v); |
|
|
|
this.combo.setValue(v); |
|
|
|
this._checkError(v); |
|
|
|
this._checkError(v); |
|
|
|