2 * @class Roo.bootstrap.menu.Item
3 * @extends Roo.bootstrap.Component
4 * @children Roo.bootstrap.Button Roo.bootstrap.ButtonUploader Roo.bootstrap.Row Roo.bootstrap.Column Roo.bootstrap.Container
5 * @parent Roo.bootstrap.menu.Menu
7 * Bootstrap MenuItem class
9 * @cfg {String} html the menu label
10 * @cfg {String} href the link
11 * @cfg {Boolean} preventDefault do not trigger A href on clicks (default false).
12 * @cfg {Boolean} isContainer is it a container - just returns a drop down item..
13 * @cfg {Boolean} active used on sidebars to highlight active itesm
14 * @cfg {String} fa favicon to show on left of menu item.
15 * @cfg {Roo.bootsrap.Menu} menu the child menu.
19 * Create a new MenuItem
20 * @param {Object} config The config object
24 Roo.bootstrap.menu.Item = function(config){
25 Roo.bootstrap.menu.Item.superclass.constructor.call(this, config);
30 * The raw click event for the entire grid.
31 * @param {Roo.bootstrap.menu.Item} this
32 * @param {Roo.EventObject} e
38 Roo.extend(Roo.bootstrap.menu.Item, Roo.bootstrap.Component, {
42 preventDefault: false,
47 getAutoCreate : function(){
52 cls: 'dropdown-menu-item '
62 cls : 'dropdown-item',
67 if (this.fa !== false) {
70 cls : 'fa fa-' + this.fa
79 cls: 'dropdown-menu-item',
82 if (this.parent().type == 'treeview') {
83 cfg.cls = 'treeview-menu';
91 anc.href = this.href || cfg.cn[0].href ;
92 ctag.html = this.html || cfg.cn[0].html ;
96 initEvents: function()
98 if (this.parent().type == 'treeview') {
99 this.el.select('a').on('click', this.onClick, this);
103 this.menu.parentType = this.xtype;
104 this.menu.triggerEl = this.el;
105 this.menu = this.addxtype(Roo.apply({}, this.menu));
109 onClick : function(e)
111 //Roo.log('item on click ');
113 if(this.href === false || this.preventDefault){
116 //this.parent().hideMenuItems();
118 this.fireEvent('click', this, e);