4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5 <title>The source code</title>
6 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
7 <script type="text/javascript" src="../resources/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> * A simple class that renders text directly into a toolbar.
22 * Ext.create('Ext.panel.Panel', {
23 * title: 'Panel with TextItem',
27 * { xtype: 'tbtext', text: 'Sample Text Item' }
29 * renderTo: Ext.getBody()
33 * Creates a new TextItem
34 * @param {Object} text A text string, or a config object containing a <tt>text</tt> property
36 Ext.define('Ext.toolbar.TextItem', {
37 extend: 'Ext.toolbar.Item',
38 requires: ['Ext.XTemplate'],
39 alias: 'widget.tbtext',
40 alternateClassName: 'Ext.Toolbar.TextItem',
42 <span id='Ext-toolbar-TextItem-cfg-text'> /**
43 </span> * @cfg {String} text The text to be used as innerHTML (html tags are accepted)
49 baseCls: Ext.baseCSSPrefix + 'toolbar-text',
51 onRender : function() {
52 Ext.apply(this.renderData, {
55 this.callParent(arguments);
58 <span id='Ext-toolbar-TextItem-method-setText'> /**
59 </span> * Updates this item's text, setting the text to be used as innerHTML.
60 * @param {String} t The text to display (html accepted).
62 setText : function(t) {
65 this.ownerCt.doLayout(); // In case an empty text item (centered at zero height) receives new text.