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 (default false).
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, {
46 preventDefault: false,
51 getAutoCreate : function(){
56 cls: 'dropdown-menu-item '
66 cls : 'dropdown-item',
71 if (this.fa !== false) {
74 cls : 'fa fa-' + this.fa
83 cls: 'dropdown-menu-item',
86 if (this.parent().type == 'treeview') {
87 cfg.cls = 'treeview-menu';
95 anc.href = this.href || cfg.cn[0].href ;
96 ctag.html = this.html || cfg.cn[0].html ;
100 initEvents: function()
102 if (this.parent().type == 'treeview') {
103 this.el.select('a').on('click', this.onClick, this);
107 this.menu.parentType = this.xtype;
108 this.menu.triggerEl = this.el;
109 this.menu = this.addxtype(Roo.apply({}, this.menu));
113 onClick : function(e)
115 Roo.log('item on click ');
117 if(this.preventDefault){
120 //this.parent().hideMenuItems();
122 this.fireEvent('click', this, e);