7 Roo.bootstrap.menu = Roo.bootstrap.menu || {};
10 * @class Roo.bootstrap.menu.Item
11 * @extends Roo.bootstrap.Component
12 * Bootstrap MenuItem class
13 * @cfg {Boolean} submenu (true | false) default false
14 * @cfg {String} html text of the item
15 * @cfg {String} href the link
16 * @cfg {Boolean} disable (true | false) default false
17 * @cfg {Boolean} preventDefault (true | false) default true
22 * @param {Object} config The config object
26 Roo.bootstrap.menu.Item = function(config){
27 Roo.bootstrap.menu.Item.superclass.constructor.call(this, config);
31 * Fires when the mouse is hovering over this menu
32 * @param {Roo.bootstrap.menu.Item} this
33 * @param {Roo.EventObject} e
38 * Fires when the mouse exits this menu
39 * @param {Roo.bootstrap.menu.Item} this
40 * @param {Roo.EventObject} e
46 * The raw click event for the entire grid.
47 * @param {Roo.EventObject} e
53 Roo.extend(Roo.bootstrap.menu.Item, Roo.bootstrap.Component, {
61 getAutoCreate : function()
66 cls : 'roo-menu-item-text',
74 cls : 'fa ' + this.icon
83 href : this.href || '#',
90 cfg.cls = (typeof(cfg.cls) == 'undefined') ? 'disabled' : (cfg.cls + ' disabled');
94 cfg.cls = (typeof(cfg.cls) == 'undefined') ? 'dropdown-submenu' : (cfg.cls + ' dropdown-submenu');
100 initEvents : function()
102 this.el.on('mouseover', this.onMouseOver, this);
103 this.el.on('mouseout', this.onMouseOut, this);
105 this.el.select('a', true).first().on('click', this.onClick, this);
109 onClick : function(e)
111 if(this.preventDefault){
115 this.fireEvent("click", this, e);
118 onMouseOver : function(e)
120 this.fireEvent("mouseover", this, e);
123 onMouseOut : function(e)
125 this.fireEvent("mouseout", this, e);