3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
4 <title>The source code</title>
5 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
6 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
8 <body onload="prettyPrint();">
9 <pre class="prettyprint lang-js">/*!
10 * Ext JS Library 3.3.0
11 * Copyright(c) 2006-2010 Ext JS, Inc.
13 * http://www.extjs.com/license
15 <div id="cls-Ext.menu.TextItem"></div>/**
16 * @class Ext.menu.TextItem
17 * @extends Ext.menu.BaseItem
18 * Adds a static text string to a menu, usually used as either a heading or group separator.
20 * Creates a new TextItem
21 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
22 * is applied as a config object (and should contain a <tt>text</tt> property).
25 Ext.menu.TextItem = Ext.extend(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",
38 constructor : function(config) {
39 if (typeof config == 'string') {
44 Ext.menu.TextItem.superclass.constructor.call(this, config);
48 onRender : function() {
49 var s = document.createElement("span");
50 s.className = this.itemCls;
51 s.innerHTML = this.text;
53 Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
56 Ext.reg('menutextitem', Ext.menu.TextItem);</pre>