3 <title>The source code</title>
\r
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
\r
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
\r
7 <body onload="prettyPrint();">
\r
8 <pre class="prettyprint lang-js"><div id="cls-Ext.menu.TextItem"></div>/**
9 * @class Ext.menu.TextItem
10 * @extends Ext.menu.BaseItem
11 * Adds a static text string to a menu, usually used as either a heading or group separator.
13 * Creates a new TextItem
14 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
15 * is applied as a config object (and should contain a <tt>text</tt> property).
18 Ext.menu.TextItem = function(cfg){
19 if(typeof cfg == 'string'){
22 Ext.menu.TextItem.superclass.constructor.call(this, cfg);
25 Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
26 <div id="cfg-Ext.menu.TextItem-text"></div>/**
27 * @cfg {String} text The text to display for this item (defaults to '')
29 <div id="cfg-Ext.menu.TextItem-hideOnClick"></div>/**
30 * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
33 <div id="cfg-Ext.menu.TextItem-itemCls"></div>/**
34 * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
36 itemCls : "x-menu-text",
39 onRender : function(){
40 var s = document.createElement("span");
41 s.className = this.itemCls;
42 s.innerHTML = this.text;
44 Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
47 Ext.reg('menutextitem', Ext.menu.TextItem);</pre>
\r