4

I added "contextmenu" entry to the list of listeners in treepanel, but it seems that it doesn't work. ExtJS doesn't give the control to my event handler function. I also supressed browser default context menu event beforehand, but it doesn't help either.

Any code examples? I haven't found any working samples for ExtJS 4. Am I missing something?

Update 1: my code

var tree = Ext.create('Ext.tree.Panel', {
    id: 'treePanel',  
    store: store,               
    renderTo: 'tree-div',
    height: 300,
    width: 250,
    title: 'OrgTree',
    useArrows: true,
    listeners: {                        
        render : {
            fn : function() {                            
                 Ext.getBody().on("contextmenu", Ext.emptyFn, null, {preventDefault: true});
            }
        },                    
        contextmenu : {                     
            fn: function(node, evtObj) {
                alert('here');
            }
        },
    }
});

Update 2: this is the solution extjs tree panel context menu not working

Community
  • 1
  • 1
Alpha Sisyphus
  • 1,508
  • 3
  • 19
  • 33

0 Answers0