2 * Ext JS Library 2.2.1
\r
3 * Copyright(c) 2006-2009, Ext JS, LLC.
\r
4 * licensing@extjs.com
\r
6 * http://extjs.com/license
\r
10 * @class Ext.menu.TextItem
\r
11 * @extends Ext.menu.BaseItem
\r
12 * Adds a static text string to a menu, usually used as either a heading or group separator.
\r
14 * Creates a new TextItem
\r
15 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
\r
16 * is applied as a config object (and should contain a <tt>text</tt> property).
\r
18 Ext.menu.TextItem = function(cfg){
\r
19 if(typeof cfg == 'string'){
\r
22 Ext.menu.TextItem.superclass.constructor.call(this, cfg);
\r
25 Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
\r
27 * @cfg {String} text The text to display for this item (defaults to '')
\r
30 * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
\r
32 hideOnClick : false,
\r
34 * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
\r
36 itemCls : "x-menu-text",
\r
39 onRender : function(){
\r
40 var s = document.createElement("span");
\r
41 s.className = this.itemCls;
\r
42 s.innerHTML = this.text;
\r
44 Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
\r