4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../prettify/prettify.js"></script>
8 <style type="text/css">
9 .highlight { display: block; background-color: #ddd; }
11 <script type="text/javascript">
12 function highlight() {
13 document.getElementById(location.hash.replace(/#/, "")).className = "highlight";
17 <body onload="prettyPrint(); highlight();">
18 <pre class="prettyprint lang-js"><span id='Ext-toolbar-TextItem-method-constructor'><span id='Ext-toolbar-TextItem'>/**
19 </span></span> * @class Ext.toolbar.TextItem
20 * @extends Ext.toolbar.Item
22 * A simple class that renders text directly into a toolbar.
26 * {@img Ext.toolbar.TextItem/Ext.toolbar.TextItem.png TextItem component}
28 * Ext.create('Ext.panel.Panel', {
29 * title: 'Panel with TextItem',
33 * {xtype: 'tbtext', text: 'Sample TextItem'}
35 * renderTo: Ext.getBody()
39 * Creates a new TextItem
40 * @param {Object} text A text string, or a config object containing a <tt>text</tt> property
43 Ext.define('Ext.toolbar.TextItem', {
44 extend: 'Ext.toolbar.Item',
45 requires: ['Ext.XTemplate'],
46 alias: 'widget.tbtext',
47 alternateClassName: 'Ext.Toolbar.TextItem',
49 <span id='Ext-toolbar-TextItem-cfg-text'> /**
50 </span> * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
56 baseCls: Ext.baseCSSPrefix + 'toolbar-text',
58 onRender : function() {
59 Ext.apply(this.renderData, {
62 this.callParent(arguments);
65 <span id='Ext-toolbar-TextItem-method-setText'> /**
66 </span> * Updates this item's text, setting the text to be used as innerHTML.
67 * @param {String} t The text to display (html accepted).
69 setText : function(t) {
72 this.ownerCt.doLayout(); // In case an empty text item (centered at zero height) receives new text.