|
|
|
@ -20,15 +20,14 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
|
|
|
|
|
_init: function () { |
|
|
|
|
BI.SelectTextTrigger.superclass._init.apply(this, arguments); |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var obj = this._digest(o.value, o.items); |
|
|
|
|
var text = this._digest(o.value, o.items); |
|
|
|
|
this.trigger = BI.createWidget({ |
|
|
|
|
type: "bi.text_trigger", |
|
|
|
|
element: this, |
|
|
|
|
height: o.height, |
|
|
|
|
readonly: o.readonly, |
|
|
|
|
text: obj.text, |
|
|
|
|
text: text, |
|
|
|
|
defaultText: o.defaultText, |
|
|
|
|
textCls: obj.textCls, |
|
|
|
|
textHgap: o.textHgap, |
|
|
|
|
textVgap: o.textVgap, |
|
|
|
|
textLgap: o.textLgap, |
|
|
|
@ -73,21 +72,9 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
if (result.length > 0 && val.length === 0) { |
|
|
|
|
return { |
|
|
|
|
textCls: "", |
|
|
|
|
text: result.join(","), |
|
|
|
|
}; |
|
|
|
|
return result.join(","); |
|
|
|
|
} else { |
|
|
|
|
var text = BI.isFunction(o.text) ? o.text() : o.text; |
|
|
|
|
if (BI.isEmptyString(text)) { |
|
|
|
|
return { |
|
|
|
|
textCls: "bi-tips", |
|
|
|
|
text: "" |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
return { |
|
|
|
|
text, |
|
|
|
|
}; |
|
|
|
|
return BI.isFunction(o.text) ? o.text() : o.text; |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -97,9 +84,8 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setValue: function (val) { |
|
|
|
|
var formatValue = this._digest(val, this.options.items); |
|
|
|
|
this.trigger.setTextCls(formatValue.textCls); |
|
|
|
|
this.trigger.setText(formatValue.text); |
|
|
|
|
var formatText = this._digest(val, this.options.items); |
|
|
|
|
this.trigger.setText(formatText); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
setTipType: function (v) { |
|
|
|
|