X-Git-Url: http://git.ithinksw.org/extjs.git/blobdiff_plain/25ef3491bd9ae007ff1fc2b0d7943e6eaaccf775..6e39d509471fe9b4e2660e0d1631b350d0c66f40:/docs/source/Item.html diff --git a/docs/source/Item.html b/docs/source/Item.html index 7979380b..ed50c05f 100644 --- a/docs/source/Item.html +++ b/docs/source/Item.html @@ -1,17 +1,12 @@ - - - The source code - - - - -
/*!
- * Ext JS Library 3.0.3
- * Copyright(c) 2006-2009 Ext JS, LLC
- * licensing@extjs.com
- * http://www.extjs.com/license
- */
-
/** + + + + The source code + + + + +
/** * @class Ext.menu.Item * @extends Ext.menu.BaseItem * A base class for all menu items that require menu-related functionality (like sub-menus) and are not static @@ -22,13 +17,7 @@ * @param {Object} config Configuration options * @xtype menuitem */ -Ext.menu.Item = function(config){ - Ext.menu.Item.superclass.constructor.call(this, config); - if(this.menu){ - this.menu = Ext.menu.MenuMgr.get(this.menu); - } -}; -Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { +Ext.menu.Item = Ext.extend(Ext.menu.BaseItem, {
/** * @property menu * @type Ext.menu.Menu @@ -73,6 +62,14 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { // private ctype: 'Ext.menu.Item', + initComponent : function(){ + Ext.menu.Item.superclass.initComponent.call(this); + if(this.menu){ + this.menu = Ext.menu.MenuMgr.get(this.menu); + this.menu.ownerCt = this; + } + }, + // private onRender : function(container, position){ if (!this.itemTpl) { @@ -91,6 +88,9 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { this.el = position ? this.itemTpl.insertBefore(position, a, true) : this.itemTpl.append(container, a, true); this.iconEl = this.el.child('img.x-menu-item-icon'); this.textEl = this.el.child('.x-menu-item-text'); + if(!this.href) { // if no link defined, prevent the default anchor event + this.mon(this.el, 'click', Ext.emptyFn, null, { preventDefault: true }); + } Ext.menu.Item.superclass.onRender.call(this, container, position); }, @@ -129,10 +129,11 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { this.iconEl.replaceClass(oldCls, this.iconCls); } }, - + //private beforeDestroy: function(){ if (this.menu){ + delete this.menu.ownerCt; this.menu.destroy(); } Ext.menu.Item.superclass.beforeDestroy.call(this); @@ -215,6 +216,6 @@ Ext.extend(Ext.menu.Item, Ext.menu.BaseItem, { } } }); -Ext.reg('menuitem', Ext.menu.Item);
- +Ext.reg('menuitem', Ext.menu.Item);
+ \ No newline at end of file