How i can create context menu for extjs grid

edtsech picture edtsech · Jul 19, 2010 · Viewed 38.8k times · Source

I can create context menu for tree and attach to 'contextmenu' event. Code:

contextMenu = new Ext.menu.Menu({
  items: [{
    text: 'Edit',
    iconCls: 'edit',
    handler: edit
  },...]
})

Ext.getCmp('tree-panel').on('contextmenu', function(node) {
  contextMenu.show(node.ui.getAnchor());
})

But how I can create context menu for grid elements?

Answer

Alan McCune picture Alan McCune · Jan 11, 2011

First define your context menu