JavaScript
Run Code
Open in Fiddle
Ext.application({ name : 'Fiddle', launch : function() { var getMenu = function (cmp) { var menu = cmp.down('menu'); if (!menu) { menu = Ext.create('Ext.menu.Menu', { items: [{ text: 'Text 1' },{ text: 'Text 2' }] }); } return menu; }; Ext.create('Ext.panel.Panel', { height: 200, renderTo: document.body, title: 'A Panel', layout: 'fit', tools: [{ type: 'gear', handler: function(e, el, owner, tool){ getMenu(owner).showBy(owner,'tr-br?'); } }] }); } });