|
|
@ -83,25 +83,22 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_checkError: function (v) { |
|
|
|
_checkError: function (v) { |
|
|
|
if (BI.isNull(v) || BI.isEmptyArray(v) || BI.isEmptyString(v)) { |
|
|
|
v = BI.isArray(v) ? v[0] : v; |
|
|
|
this.trigger.options.tipType = "success"; |
|
|
|
var tipType = null; |
|
|
|
|
|
|
|
var result = BI.find(this.options.items, function (idx, item) { |
|
|
|
|
|
|
|
return v === item.value; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (BI.isNull(result)) { |
|
|
|
|
|
|
|
if (this.isEnabled()) { |
|
|
|
|
|
|
|
tipType = "warning"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.element.addClass("error"); |
|
|
|
|
|
|
|
this.trigger.element.addClass("error"); |
|
|
|
|
|
|
|
} else { |
|
|
|
this.element.removeClass("error"); |
|
|
|
this.element.removeClass("error"); |
|
|
|
this.trigger.element.removeClass("error"); |
|
|
|
this.trigger.element.removeClass("error"); |
|
|
|
} else { |
|
|
|
|
|
|
|
v = BI.isArray(v) ? v : [v]; |
|
|
|
|
|
|
|
var result = BI.find(this.options.items, function (idx, item) { |
|
|
|
|
|
|
|
return BI.contains(v, item.value); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
if (BI.isNull(result)) { |
|
|
|
|
|
|
|
this.trigger.setTipType("warning"); |
|
|
|
|
|
|
|
this.element.addClass("error"); |
|
|
|
|
|
|
|
this.trigger.element.addClass("error"); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
this.trigger.setTipType("success"); |
|
|
|
|
|
|
|
this.element.removeClass("error"); |
|
|
|
|
|
|
|
this.trigger.element.removeClass("error"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.trigger.setTipType(tipType); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|