How i can create context menu for extjs grid

前端 未结 5 447
我寻月下人不归
我寻月下人不归 2021-02-04 03:08

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

contextMenu = new Ext.menu.Menu({
  items: [{
    text: \'Edit\',
    iconCls: \'ed         


        
5条回答
  •  迷失自我
    2021-02-04 03:23

    have to add this property in your grid for example :

    viewConfig: {
                stripeRows: true,
                listeners: {
                    itemcontextmenu: function(view, rec, node, index, e) {
                        e.stopEvent();
                        contextMenu.showAt(e.getXY());
                        return false;
                    }
                }
            },
    

提交回复
热议问题