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} preventDefault (true | false) default true
21 * @param {Object} config The config object
25 Roo.bootstrap.menu.Item = function(config){
26 Roo.bootstrap.menu.Item.superclass.constructor.call(this, config);
30 * Fires when the mouse is hovering over this menu
31 * @param {Roo.bootstrap.menu.Item} this
32 * @param {Roo.EventObject} e
37 * Fires when the mouse exits this menu
38 * @param {Roo.bootstrap.menu.Item} this
39 * @param {Roo.EventObject} e
45 * The raw click event for the entire grid.
46 * @param {Roo.EventObject} e
52 Roo.extend(Roo.bootstrap.menu.Item, Roo.bootstrap.Component, {
59 getAutoCreate : function()
63 cls : (this.submenu) ? 'dropdown-submenu' : '',
67 href : this.href || '#',
76 initEvents : function()
78 this.el.on('mouseover', this.onMouseOver, this);
79 this.el.on('mouseout', this.onMouseOut, this);
82 this.el.select('.dropdown-submenu > a', true).first().on('click', this.onClick, this);
84 this.el.on('click', this.onClick, this);
92 this.fireEvent("click", this, e);
95 onMouseOver : function(e)
97 this.fireEvent("mouseover", this, e);
100 onMouseOut : function(e)
102 this.fireEvent("mouseout", this, e);