10 * @class Roo.bootstrap.MenuItem
11 * @extends Roo.bootstrap.Component
12 * Bootstrap MenuItem class
13 * @cfg {String} html the menu label
14 * @cfg {String} href the link
15 * @cfg {Boolean} preventDefault do not trigger A href on clicks.
16 * @cfg {Boolean} isContainer is it a container - just returns a drop down item..
17 * @cfg {Boolean} active used on sidebars to highlight active itesm
18 * @cfg {String} fa favicon to show on left of menu item.
19 * @cfg {Roo.bootsrap.Menu} menu the child menu.
23 * Create a new MenuItem
24 * @param {Object} config The config object
28 Roo.bootstrap.MenuItem = function(config){
29 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
34 * The raw click event for the entire grid.
35 * @param {Roo.bootstrap.MenuItem} this
36 * @param {Roo.EventObject} e
42 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
51 getAutoCreate : function(){
56 cls: 'dropdown-menu-item'
70 if (this.fa !== false) {
73 cls : 'fa fa-' + this.fa
82 cls: 'dropdown-menu-item',
85 if (this.parent().type == 'treeview') {
86 cfg.cls = 'treeview-menu';
94 anc.href = this.href || cfg.cn[0].href ;
95 ctag.html = this.html || cfg.cn[0].html ;
99 initEvents: function()
101 if (this.parent().type == 'treeview') {
102 this.el.select('a').on('click', this.onClick, this);
105 this.menu.parentType = this.xtype;
106 this.menu.triggerEl = this.el;
107 this.menu = this.addxtype(Roo.apply({}, this.menu));
111 onClick : function(e)
113 Roo.log('item on click ');
114 //if(this.preventDefault){
115 // e.preventDefault();
117 //this.parent().hideMenuItems();
119 this.fireEvent('click', this, e);