JavaScript
Run Code
Open in Fiddle
var globalMenuHandle = null; Ext.application({ name: 'Fiddle', launch: function () { globalMenuHandle = new Ext.menu.Menu({ items: [{ text: 'Menu Item', handler: function () { Ext.toast("hello"); } }] }); Ext.create("Ext.button.Button", { text: "Menu", menu: globalMenuHandle, renderTo: Ext.getBody() }) Ext.create("Ext.button.Button", { text: "Modal", handler: function() { Ext.Msg.alert('oi'); globalMenuHandle.hidden = false; }, renderTo: Ext.getBody() }); Ext.create("Ext.button.Button", { text: "HideMnu", handler: function() { globalMenuHandle.hide(); globalMenuHandle.hidden = true; }, renderTo: Ext.getBody() }); Ext.create("Ext.button.Button", { text: "ShowMnu", handler: function() { globalMenuHandle.show(); globalMenuHandle.hidden = false; }, renderTo: Ext.getBody() }); Ext.create("Ext.window.Window", { title: "MyWindow", width: 400, height: 300, html: "<h3>Steps to reproduce the issue</h3><p>1. Click the menu button.</p><p>2. Click the <b>Modal</b> button</p><p>3. Click again the menu button.</p><p><i>You can skip step 1, menu will break by clicking the modal button anyway.</i></p>" }).show(); } });