1 <!DOCTYPE html><html><head><title>Sencha Documentation Project</title><link rel="stylesheet" href="../reset.css" type="text/css"><link rel="stylesheet" href="../prettify.css" type="text/css"><link rel="stylesheet" href="../prettify_sa.css" type="text/css"><script type="text/javascript" src="../prettify.js"></script></head><body onload="prettyPrint()"><pre class="prettyprint"><pre><span id='Ext-toolbar.TextItem-method-constructor'><span id='Ext-toolbar.TextItem'>/**
2 </span></span> * @class Ext.toolbar.TextItem
3 * @extends Ext.toolbar.Item
5 * A simple class that renders text directly into a toolbar.
9 * {@img Ext.toolbar.TextItem/Ext.toolbar.TextItem.png TextItem component}
11 * Ext.create('Ext.panel.Panel', {
12 * title: 'Panel with TextItem',
16 * {xtype: 'tbtext', text: 'Sample TextItem'}
18 * renderTo: Ext.getBody()
22 * Creates a new TextItem
23 * @param {Object} text A text string, or a config object containing a <tt>text</tt> property
26 Ext.define('Ext.toolbar.TextItem', {
27 extend: 'Ext.toolbar.Item',
28 requires: ['Ext.XTemplate'],
29 alias: 'widget.tbtext',
30 alternateClassName: 'Ext.Toolbar.TextItem',
32 <span id='Ext-toolbar.TextItem-cfg-text'> /**
33 </span> * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
39 baseCls: Ext.baseCSSPrefix + 'toolbar-text',
41 onRender : function() {
42 Ext.apply(this.renderData, {
45 this.callParent(arguments);
48 <span id='Ext-toolbar.TextItem-method-setText'> /**
49 </span> * Updates this item's text, setting the text to be used as innerHTML.
50 * @param {String} t The text to display (html accepted).
52 setText : function(t) {
55 this.ownerCt.doLayout(); // In case an empty text item (centered at zero height) receives new text.
60 });</pre></pre></body></html>