1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    13
    Vote Rating
    0
    lucasmarin is on a distinguished road

      0  

    Default Problem: contextmenu on treepanel

    Problem: contextmenu on treepanel


    I can't show contextmenu when i click with right button in a tree node.

    code:

    PHP Code:
    Ext.namespace("Mandic.tree");

    Mandic.tree.ImapFolderTree = function(config){
        
    Ext.apply(thisconfig);
        
        
    Mandic.tree.ImapFolderTree.superclass.constructor.call(this, {})
        
        
    this.on('contextmenu'this.rightButtonMenuthis);
        
    this.root.expand();
    }


    Ext.extend(Mandic.tree.ImapFolderTreeExt.tree.TreePanel, {

        
    rightButtonMenu: function(ne){
        
            var 
    menuC = new Ext.menu.Menu({ 
                    
    id'mainContext',
                    
    items: [{
                        
    text'edit',
                        
    handleronItemClick
                    
    },{
                        
    text'delete',
                        
    handleronItemClick 
                    
    }]
            });
        
            
    menuC.show(n);
        }
    });

    Mandic.tree.FolderTree = function(config){
        
    Ext.apply(thisconfig);
        
        
    this.loader = new Ext.tree.TreeLoader({
            
    dataUrlMandic.settings.folder.inboxAction,
            
    scopethis
        
    });
        
        
    this.root = new Ext.tree.AsyncTreeNode({
            
    text'Entrada',
            
    allowDragfalse,
            
    id'INBOX',
            
    url'SU5CT1g='// INBOX base64 encoded
            
    selecttrue,
            
    scopethis
        
    });
        
        
    Mandic.tree.FolderTree.superclass.constructor.call(this, {
            
    autoWidthtrue
        
    });
        
        
    this.dropActionUrl Mandic.settings.folder.moveMessageAction;
        
        
    this.root.expand();
    }

    Ext.extend(Mandic.tree.FolderTreeMandic.tree.ImapFolderTree, {}); 

    The error in firebug:
    [Exception... "'Element.alignToXY with an element that doesn't exist' when calling method: [nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]

    Line 0


    Where is the problem??

    Tks.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,066
    Vote Rating
    659
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Menu.show() expects an element, however you're passing it a tree node.

    Code:
    menu.showAt(e.getXY());
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    13
    Vote Rating
    0
    lucasmarin is on a distinguished road

      0  

    Default


    Thanks Evant! =D

  4. #4
    Sencha - Ext JS Dev Team Animal's Avatar
    Join Date
    Mar 2007
    Location
    Notts/Redwood City
    Posts
    30,508
    Vote Rating
    58
    Animal has a spectacular aura about Animal has a spectacular aura about Animal has a spectacular aura about

      0  

    Default


    You sure you want to create a new Menu every time they click the right mouse button?

Thread Participants: 2