Форк Rambox
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.
 
 
 

55 lines
1.3 KiB

/**
* A simple class that renders text directly into a toolbar.
*
* @example
* Ext.create('Ext.panel.Panel', {
* title: 'Panel with TextItem',
* width: 300,
* height: 200,
* tbar: [
* { xtype: 'tbtext', html: 'Sample Text Item' }
* ],
* renderTo: Ext.getBody()
* });
*
*/
Ext.define('Ext.toolbar.TextItem', {
extend: 'Ext.toolbar.Item',
// Toolbar required here because we'll try to decorate it's alternateClassName
// with this class' alternate name
requires: ['Ext.toolbar.Toolbar', 'Ext.XTemplate'],
alias: 'widget.tbtext',
alternateClassName: 'Ext.Toolbar.TextItem',
/**
* @cfg {String} text
* The text to be used as innerHTML (html tags are accepted).
*
* @deprecated 5.1.0 Use {@link #html}
*/
text: '',
baseCls: Ext.baseCSSPrefix + 'toolbar-text',
ariaRole: null,
beforeRender : function() {
var text = this.text;
this.callParent();
if (text) {
this.html = text;
}
},
/**
* Updates this item's text, setting the text to be used as innerHTML.
* @param {String} text The text to display (html accepted).
*
* @deprecated 5.1.0 Use {@link #update}
*/
setText : function(text) {
this.update(text);
}
});