Upgrade to ExtJS 4.0.2 - Released 06/09/2011
[extjs.git] / src / menu / Separator.js
1 /*
2
3 This file is part of Ext JS 4
4
5 Copyright (c) 2011 Sencha Inc
6
7 Contact:  http://www.sencha.com/contact
8
9 GNU General Public License Usage
10 This file may be used under the terms of the GNU General Public License version 3.0 as published by the Free Software Foundation and appearing in the file LICENSE included in the packaging of this file.  Please review the following information to ensure the GNU General Public License version 3.0 requirements will be met: http://www.gnu.org/copyleft/gpl.html.
11
12 If you are unsure which license is appropriate for your use, please contact the sales department at http://www.sencha.com/contact.
13
14 */
15 /**
16  * @class Ext.menu.Separator
17  * @extends Ext.menu.Item
18  *
19  * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will
20  * add one of these by using "-" in your call to add() or in your items config rather than creating one directly.
21  *
22  * {@img Ext.menu.Separator/Ext.menu.Separator.png Ext.menu.Separator component}
23  *
24  * ## Code 
25  *
26  *     Ext.create('Ext.menu.Menu', {
27  *         width: 100,
28  *         height: 100,
29  *         floating: false,  // usually you want this set to True (default)
30  *         renderTo: Ext.getBody(),  // usually rendered by it's containing component
31  *         items: [{
32  *             text: 'icon item',
33  *             iconCls: 'add16'
34  *         },{
35  *             xtype: 'menuseparator'
36  *         },{
37  *            text: 'seperator above',
38  *         },{
39  *            text: 'regular item',
40  *         }]
41  *     }); 
42  *
43  * @markdown
44  */
45 Ext.define('Ext.menu.Separator', {
46     extend: 'Ext.menu.Item',
47     alias: 'widget.menuseparator',
48     
49     /**
50      * @cfg {String} activeCls @hide
51      */
52     
53     /**
54      * @cfg {Boolean} canActivate @hide
55      */
56     canActivate: false,
57     
58     /**
59      * @cfg {Boolean} clickHideDelay @hide
60      */
61      
62     /**
63      * @cfg {Boolean} destroyMenu @hide
64      */
65      
66     /**
67      * @cfg {Boolean} disabledCls @hide
68      */
69      
70     focusable: false,
71      
72     /**
73      * @cfg {String} href @hide
74      */
75     
76     /**
77      * @cfg {String} hrefTarget @hide
78      */
79     
80     /**
81      * @cfg {Boolean} hideOnClick @hide
82      */
83     hideOnClick: false,
84     
85     /**
86      * @cfg {String} icon @hide
87      */
88     
89     /**
90      * @cfg {String} iconCls @hide
91      */
92     
93     /**
94      * @cfg {Mixed} menu @hide
95      */
96     
97     /**
98      * @cfg {String} menuAlign @hide
99      */
100     
101     /**
102      * @cfg {Number} menuExpandDelay @hide
103      */
104     
105     /**
106      * @cfg {Number} menuHideDelay @hide
107      */
108     
109     /**
110      * @cfg {Boolean} plain @hide
111      */
112     plain: true,
113     
114     /**
115      * @cfg {String} separatorCls
116      * The CSS class used by the separator item to show the incised line.
117      * Defaults to `Ext.baseCSSPrefix + 'menu-item-separator'`.
118      * @markdown
119      */
120     separatorCls: Ext.baseCSSPrefix + 'menu-item-separator',
121     
122     /**
123      * @cfg {String} text @hide
124      */
125     text: ' ',
126     
127     onRender: function(ct, pos) {
128         var me = this,
129             sepCls = me.separatorCls;
130             
131         me.cls += ' ' + sepCls;
132         
133         Ext.applyIf(me.renderSelectors, {
134             itemSepEl: '.' + sepCls
135         });
136         
137         me.callParent(arguments);
138     }
139 });