3 * Copyright(c) 2006-2010 Ext JS, LLC
5 * http://www.extjs.com/license
8 * @class Ext.menu.TextItem
9 * @extends Ext.menu.BaseItem
10 * Adds a static text string to a menu, usually used as either a heading or group separator.
12 * Creates a new TextItem
13 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
14 * is applied as a config object (and should contain a <tt>text</tt> property).
17 Ext.menu.TextItem = Ext.extend(Ext.menu.BaseItem, {
19 * @cfg {String} text The text to display for this item (defaults to '')
22 * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
26 * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
28 itemCls : "x-menu-text",
30 constructor : function(config){
31 if(typeof config == 'string'){
32 config = {text: config}
34 Ext.menu.TextItem.superclass.constructor.call(this, config);
38 onRender : function(){
39 var s = document.createElement("span");
40 s.className = this.itemCls;
41 s.innerHTML = this.text;
43 Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
46 Ext.reg('menutextitem', Ext.menu.TextItem);