PDA

View Full Version : Gridpanel: Contextmenu / right-click menu



jlg
14 Mar 2011, 6:12 AM
Hi,

does anyone have a code example of how to configure a right-click / context menu in a gridpanel?

I've managed to solve this in ExtJS 3 by using the contextMenu configuration, but this seems to be different in ExtJS 4.

jlg
15 Mar 2011, 3:09 AM
Figured it out. Ext.grid.GridPanel has been re-written so the contextmenu has to be configured through the View.

Example:



this.grid = new Ext.grid.GridPanel({
viewConfig: {
listeners: {
contextmenu: function(view, index, node, e){
...your menu code...
}
}
});

{