Browse Source

无JIRA任务 feat: BI.SearchTextValueCombo 的defaultText和text区分开

es6
dailer 3 years ago
parent
commit
0f75429975
  1. 6
      src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js
  2. 6
      src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js

6
src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js

@ -7,6 +7,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
baseCls: "bi-search-text-value-combo", baseCls: "bi-search-text-value-combo",
height: 24, height: 24,
text: "", text: "",
defaultText: "",
items: [], items: [],
tipType: "", tipType: "",
warningTitle: "", warningTitle: "",
@ -36,6 +37,7 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
items: o.items, items: o.items,
height: o.height - 2, height: o.height - 2,
text: o.text, text: o.text,
defaultText: o.defaultText,
value: o.value, value: o.value,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
@ -117,13 +119,13 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, {
created: function () { created: function () {
var o = this.options; var o = this.options;
if(BI.isKey(o.value)) { if (BI.isKey(o.value)) {
this._checkError(o.value); this._checkError(o.value);
} }
}, },
_checkError: function (v) { _checkError: function (v) {
if(BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) {
this.trigger.options.tipType = "success"; this.trigger.options.tipType = "success";
this.element.removeClass("combo-error"); this.element.removeClass("combo-error");
} else { } else {

6
src/case/combo/searchtextvaluecombo/trigger.searchtextvalue.js

@ -29,7 +29,7 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
self.editor = this; self.editor = this;
}, },
watermark: o.watermark, watermark: o.watermark,
defaultText: o.text, defaultText: o.defaultText,
text: this._digest(o.value, o.items), text: this._digest(o.value, o.items),
value: o.value, value: o.value,
height: o.height, height: o.height,
@ -69,7 +69,7 @@ BI.SearchTextValueTrigger = BI.inherit(BI.Trigger, {
this.editor.setState(v); this.editor.setState(v);
}, },
_digest: function(vals, items){ _digest: function (vals, items) {
var o = this.options; var o = this.options;
vals = BI.isArray(vals) ? vals : [vals]; vals = BI.isArray(vals) ? vals : [vals];
var result = []; var result = [];
@ -111,4 +111,4 @@ BI.SearchTextValueTrigger.EVENT_SEARCHING = "EVENT_SEARCHING";
BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP"; BI.SearchTextValueTrigger.EVENT_STOP = "EVENT_STOP";
BI.SearchTextValueTrigger.EVENT_START = "EVENT_START"; BI.SearchTextValueTrigger.EVENT_START = "EVENT_START";
BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE"; BI.SearchTextValueTrigger.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger); BI.shortcut("bi.search_text_value_trigger", BI.SearchTextValueTrigger);

Loading…
Cancel
Save