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.
22 * Create a new MenuItem
23 * @param {Object} config The config object
27 Roo.bootstrap.MenuItem = function(config){
28 Roo.bootstrap.MenuItem.superclass.constructor.call(this, config);
33 * The raw click event for the entire grid.
34 * @param {Roo.bootstrap.MenuItem} this
35 * @param {Roo.EventObject} e
41 Roo.extend(Roo.bootstrap.MenuItem, Roo.bootstrap.Component, {
50 getAutoCreate : function(){
55 cls: 'dropdown-menu-item'
69 if (this.fa !== false) {
72 cls : 'fa fa-' + this.fa
81 cls: 'dropdown-menu-item',
84 if (this.parent().type == 'treeview') {
85 cfg.cls = 'treeview-menu';
93 anc.href = this.href || cfg.cn[0].href ;
94 ctag.html = this.html || cfg.cn[0].html ;
98 initEvents: function() {
99 if (this.parent().type == 'treeview') {
100 this.el.select('a').on('click', this.onClick, this);
104 onClick : function(e)
106 Roo.log('item on click ');
107 //if(this.preventDefault){
108 // e.preventDefault();
110 //this.parent().hideMenuItems();
112 this.fireEvent('click', this, e);