var menu1 = new Ext.menu.Menu({ items: [{ text: \'Open in new tab\' }] }); var treePanel = Ext.create(\'Ext.tree.Panel\', { id: \'tree-panel\',
Tree doesn't have contextmenu event in ExtJS4.
contextmenu
You should use itemcontextmenu instead of contextmenu:
treePanel.on('itemcontextmenu', function(view, record, item, index, event) { alert(record) //treePanelCurrentNode = record; menu1.showAt(event.getXY()); event.stopEvent(); }, this);