1 mainGrid.on("rowcontextmenu",function(grid, rowIndex,e){ 2 e.preventDefault(); 3 if (rowIndex < 0) { return; } 4 var materialMenu = new Ext.menu.Menu({ 5 items : [ 6 {text : "增加", 7 id : 'add', 8 handler : function(){} 9 }, 10 { text : "修改", 11 id : 'update', 12 menu: new Ext.menu.Menu({ 13 items: [{ 14 text: '默认商品一', 15 handler : function(){ 16 var record = grid.getStore().getAt(rowIndex); 17 alert(record.data.BRAND_NAME); 18 } 19 }, { 20 text: '默认商品二' 21 }] 22 }) 23 }, 24 {text : "删除", 25 id : 'delete', 26 handler : function() {} 27 }] 28 }); 29 materialMenu.showAt(e.getXY());