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