/** * 文字trigger * * Created by GUY on 2015/9/15. * @class BI.TextTrigger * @extends BI.Trigger */ BI.TextTrigger = BI.inherit(BI.Trigger, { _const: { hgap: 4 }, _defaultConfig: function () { var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); return BI.extend(conf, { baseCls: (conf.baseCls || "") + " bi-text-trigger", height: 24 }); }, _init: function () { BI.TextTrigger.superclass._init.apply(this, arguments); var self = this, o = this.options, c = this._const; this.text = BI.createWidget({ type: "bi.label", textAlign: "left", height: o.height, text: o.text, title: function () { return self.text.getText(); }, hgap: c.hgap, readonly: o.readonly }); this.trigerButton = BI.createWidget({ type: "bi.trigger_icon_button", width: o.triggerWidth || o.height }); BI.createWidget({ element: this, type: "bi.htape", items: [ { el: this.text }, { el: this.trigerButton, width: o.triggerWidth || o.height } ] }); }, setText: function (text) { this.text.setText(text); } }); BI.shortcut("bi.text_trigger", BI.TextTrigger);