source: trunk/web/addons/job_monarch/lib/extjs/source/widgets/menu/TextItem.js @ 619

Last change on this file since 619 was 619, checked in by ramonb, 15 years ago

lib/:

  • added new AJAX dependancies: ExtJS, pChart, Lightbox2
File size: 1.4 KB
Line 
1/*
2 * Ext JS Library 2.2.1
3 * Copyright(c) 2006-2009, Ext JS, LLC.
4 * licensing@extjs.com
5 *
6 * http://extjs.com/license
7 */
8
9/**
10 * @class Ext.menu.TextItem
11 * @extends Ext.menu.BaseItem
12 * Adds a static text string to a menu, usually used as either a heading or group separator.
13 * @constructor
14 * Creates a new TextItem
15 * @param {Object/String} config If config is a string, it is used as the text to display, otherwise it
16 * is applied as a config object (and should contain a <tt>text</tt> property).
17 */
18Ext.menu.TextItem = function(cfg){
19    if(typeof cfg == 'string'){
20        cfg = {text: cfg}
21    }
22    Ext.menu.TextItem.superclass.constructor.call(this, cfg);
23};
24
25Ext.extend(Ext.menu.TextItem, Ext.menu.BaseItem, {
26    /**
27     * @cfg {String} text The text to display for this item (defaults to '')
28     */
29    /**
30     * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
31     */
32    hideOnClick : false,
33    /**
34     * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
35     */
36    itemCls : "x-menu-text",
37
38    // private
39    onRender : function(){
40        var s = document.createElement("span");
41        s.className = this.itemCls;
42        s.innerHTML = this.text;
43        this.el = s;
44        Ext.menu.TextItem.superclass.onRender.apply(this, arguments);
45    }
46});
Note: See TracBrowser for help on using the repository browser.