3 <title>The source code</title>
4 <link href="../resources/prettify/prettify.css" type="text/css" rel="stylesheet" />
5 <script type="text/javascript" src="../resources/prettify/prettify.js"></script>
7 <body onload="prettyPrint();">
8 <pre class="prettyprint lang-js">/*!
10 * Copyright(c) 2006-2009 Ext JS, LLC
12 * http://www.extjs.com/license
14 <div id="cls-Ext.menu.TextItem"></div>/**
15 * @class Ext.menu.TextItem
16 * @extends Ext.menu.BaseItem
17 * Adds a static text string to a menu, usually used as either a heading or group separator.
19 * Creates a new TextItem
20 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
21 * is applied as a config object (and should contain a <tt>text</tt> property).
24 Ext.menu.TextItem = function(cfg){
25 if(typeof cfg == 'string'){
28 Ext.menu.TextItem.superclass.constructor.call(this, cfg);
31 Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
32 <div id="cfg-Ext.menu.TextItem-text"></div>/**
33 * @cfg {String} text The text to display for this item (defaults to '')
35 <div id="cfg-Ext.menu.TextItem-hideOnClick"></div>/**
36 * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
39 <div id="cfg-Ext.menu.TextItem-itemCls"></div>/**
40 * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
42 itemCls : "x-menu-text",
45 onRender : function(){
46 var s = document.createElement("span");
47 s.className = this.itemCls;
48 s.innerHTML = this.text;
50 Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
53 Ext.reg('menutextitem', Ext.menu.TextItem);</pre>