RIAForge Forums Home | Search | RSS
New Topic Reply   Previous Page  Page: 1   Previous Page

Thread: Example of context menu with a treepanel
Created on: 03/16/09 12:07 PM Replies: 0
evagoras


Joined: 03/16/09
Posts: 3
Example of context menu with a treepanel
03/16/09 12:07 PM

I was able to get a context menu working by wrapping the following code within an <ext:treepanel> tag. Here's the code I used:

<ext:listener eventName="contextmenu">
         function(node, e){
            e.stopEvent();
            node.select();
            var mainContextMenu = new Ext.menu.Menu('mainContext');
            mainContextMenu.add(
               new Ext.menu.Item({text:'Edit Article', iconCls:'icon-edit', handler:editPage}),
               new Ext.menu.Item({text:'Delete Article', iconCls:'icon-cross', handler:deletePage}),
               new Ext.menu.Separator(),
               new Ext.menu.Item({text:'Add New Article', iconCls:'icon-add', handler:addPage})
            );
            mainContextMenu.showAt(e.getXY());
         }
      </ext:listener>
Link | Top | Bottom

New Post
Please login to post a response.