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
6 * Bootstrap MenuItem class
8 * @cfg {String} html the menu label
9 * @cfg {String} href the link
10 * @cfg {Boolean} preventDefault do not trigger A href on clicks (default false).
11 * @cfg {Boolean} isContainer is it a container - just returns a drop down item..
12 * @cfg {Boolean} active used on sidebars to highlight active itesm
13 * @cfg {String} fa favicon to show on left of menu item.
14 * @cfg {Roo.bootsrap.Menu} menu the child menu.
18 * Create a new MenuItem
19 * @param {Object} config The config object
23 Roo.bootstrap.menu.Item = function(config){
24 Roo.bootstrap.menu.Item.superclass.constructor.call(this, config);
29 * The raw click event for the entire grid.
30 * @param {Roo.bootstrap.menu.Item} this
31 * @param {Roo.EventObject} e
37 Roo.extend(Roo.bootstrap.menu.Item, Roo.bootstrap.Component, {
41 preventDefault: false,
46 getAutoCreate : function(){
51 cls: 'dropdown-menu-item '
61 cls : 'dropdown-item',
66 if (this.fa !== false) {
69 cls : 'fa fa-' + this.fa
78 cls: 'dropdown-menu-item',
81 if (this.parent().type == 'treeview') {
82 cfg.cls = 'treeview-menu';
90 anc.href = this.href || cfg.cn[0].href ;
91 ctag.html = this.html || cfg.cn[0].html ;
95 initEvents: function()
97 if (this.parent().type == 'treeview') {
98 this.el.select('a').on('click', this.onClick, this);
102 this.menu.parentType = this.xtype;
103 this.menu.triggerEl = this.el;
104 this.menu = this.addxtype(Roo.apply({}, this.menu));
108 onClick : function(e)
110 Roo.log('item on click ');
112 if(this.preventDefault){
115 //this.parent().hideMenuItems();
117 this.fireEvent('click', this, e);