|
|
@ -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; |
|
|
|
this.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) { |
|
|
|
var result = BI.find(this.options.items, function (idx, item) { |
|
|
|
return BI.contains(v, item.value); |
|
|
|
return v === item.value; |
|
|
|
}); |
|
|
|
}); |
|
|
|
if (BI.isNull(result)) { |
|
|
|
if (BI.isNull(result)) { |
|
|
|
this.trigger.setTipType("warning"); |
|
|
|
if (this.isEnabled()) { |
|
|
|
|
|
|
|
tipType = "warning"; |
|
|
|
|
|
|
|
} |
|
|
|
this.element.addClass("error"); |
|
|
|
this.element.addClass("error"); |
|
|
|
this.trigger.element.addClass("error"); |
|
|
|
this.trigger.element.addClass("error"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.trigger.setTipType("success"); |
|
|
|
|
|
|
|
this.element.removeClass("error"); |
|
|
|
this.element.removeClass("error"); |
|
|
|
this.trigger.element.removeClass("error"); |
|
|
|
this.trigger.element.removeClass("error"); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
this.trigger.setTipType(tipType); |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
setValue: function (v) { |
|
|
|
setValue: function (v) { |
|
|
|