You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
1.5 KiB
62 lines
1.5 KiB
/** |
|
* 文字trigger |
|
* |
|
* Created by GUY on 2015/9/15. |
|
* @class BI.TextTrigger |
|
* @extends BI.Trigger |
|
*/ |
|
BI.TextTrigger = BI.inherit(BI.Trigger, { |
|
_const: { |
|
hgap: 4, |
|
triggerWidth: 30 |
|
}, |
|
|
|
_defaultConfig: function () { |
|
var conf = BI.TextTrigger.superclass._defaultConfig.apply(this, arguments); |
|
return BI.extend(conf, { |
|
baseCls: (conf.baseCls || "") + " bi-text-trigger", |
|
height: 30 |
|
}); |
|
}, |
|
|
|
_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, |
|
hgap: c.hgap |
|
}); |
|
this.trigerButton = BI.createWidget({ |
|
type: "bi.trigger_icon_button", |
|
cls: "bi-border-left", |
|
width: c.triggerWidth |
|
}); |
|
|
|
BI.createWidget({ |
|
element: this, |
|
type: 'bi.htape', |
|
items: [ |
|
{ |
|
el: this.text |
|
}, { |
|
el: this.trigerButton, |
|
width: c.triggerWidth |
|
} |
|
] |
|
}); |
|
}, |
|
|
|
setValue: function (value) { |
|
this.text.setValue(value); |
|
this.text.setTitle(value); |
|
}, |
|
|
|
setText: function (text) { |
|
this.text.setText(text); |
|
this.text.setTitle(text); |
|
} |
|
}); |
|
BI.shortcut("bi.text_trigger", BI.TextTrigger); |