4 * Copyright(c) 2006-2007, Ext JS, LLC.
6 * Originally Released Under LGPL - original licence link has changed is not relivant.
9 * <script type="text/javascript">
13 * @class Roo.menu.TextItem
14 * @extends Roo.menu.BaseItem
15 * Adds a static text string to a menu, usually used as either a heading or group separator.
16 * Note: old style constructor with text is still supported.
19 * Creates a new TextItem
20 * @param {Object} cfg Configuration
22 Roo.menu.TextItem = function(cfg){
23 if (typeof(cfg) == 'string') {
29 Roo.menu.TextItem.superclass.constructor.call(this);
32 Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, {
34 * @cfg {Boolean} text Text to show on item.
39 * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
43 * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
45 itemCls : "x-menu-text",
48 onRender : function(){
49 var s = document.createElement("span");
50 s.className = this.itemCls;
51 s.innerHTML = this.text;
53 Roo.menu.TextItem.superclass.onRender.apply(this, arguments);