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