-
14 Jun 2012 12:26 AM #1
Ext JS 4.1.1 RC2 - Ext.layout.container.BoxOverflow.Menu.destroy throws Exception
Ext JS 4.1.1 RC2 - Ext.layout.container.BoxOverflow.Menu.destroy throws Exception
Ext.layout.container.BoxOverflow.Menu.destroy Method throws Exception because me.menuTrigger is undefined.
The Exception: Uncaught TypeError: Cannot call method 'getItemId' of undefined
Here is the call Stack:
trigger is undefined
menu.jpgAbstractMixedCollection.jpggetComponentId.jpg
FIX:
Code:destroy: function() { var trigger = this.menuTrigger; // <-- menuTrigger can be undefined if (trigger && !this.layout.owner.items.contains(trigger)) { // fix for this bug // Ensure we delete the ownerCt if it's not in the items // so we don't get spurious container remove warnings. delete trigger.ownerCt; } Ext.destroy(this.menu, trigger); }
The destroy Method of Ext.layout.container.BoxOverflow.Menu.destroy in Ext 4.1.1 RC1 looked a bit simpler:
Sadly I have no test case at the moment...Code:destroy: function() { Ext.destroy(this.menu, this.menuTrigger); }Last edited by campersau1; 14 Jun 2012 at 1:41 AM. Reason: Added possible fix
-
14 Jun 2012 12:30 AM #2
Is this is you destroy before/after the overflow has happened?
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
14 Jun 2012 12:58 AM #3
Yes that caused this error!
The menu was inside a tab which was never activated.
If I activate the tab and then destroy the hole tabpanel then it worked without throwing the exception.
-
14 Jun 2012 12:59 AM #4
That's odd. Since it calls Ext.destroy() it checks if the object isn't null first. Will have to check it out.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
14 Jun 2012 1:12 AM #5
In the pictures you can see that the menu is distroyed via Ext.destroy.
The Ext.destroy Method then calls the menu.destroy method, which in Ext 4.1.1 RC2 looks like this:
Code:destroy: function() { var trigger = this.menuTrigger; // <-- menuTrigger can be undefined if (trigger && !this.layout.owner.items.contains(trigger)) { // fix for this bug // Ensure we delete the ownerCt if it's not in the items // so we don't get spurious container remove warnings. delete trigger.ownerCt; } Ext.destroy(this.menu, trigger); }
-
10 Jul 2012 5:55 AM #6
Success! Looks like we've fixed this one. According to our records the fix was applied for
EXTJSIV-6528
in
4.1.


Reply With Quote