---
title: "Ext Grid 右键菜单"
author: "dayone"
date: "2010-09-16T14:09:48Z"
tags: ["EXT"]
categories: ["Web前端"]
slug: "ext-grid"
draft: false
lastmod: "2010-09-16T14:09:48Z"
id: 764854
url: "https://dayone.iteye.com/blog/764854"
---

```
groupGrid.on("rowcontextmenu", function (grid, rowIndex, e) { 
	e.preventDefault(); 
	if (rowIndex < 0) { 
		return; 
	} 
	var treeMenu = new Ext.menu.Menu ([ 
		{ 
			xtype: "", 
			text: "详细", 
			iconCls: 'context-dog', 
			pressed: false, 
			handler: function () { 
				//获得行数据 
				var record = grid.getStore().getAt(rowIndex); 
				//open_receive_detailWindow(record.data.smsIndex); 
				alert(record.data.company);  //company为自定义的字段名称
				//record.data.taskId 
			} 
		}, { 
			xtype: "", 
			text: "删除", 
			iconCls: 'context-cat', 
			pressed: false, 
			handler: function () { 
				//获得行数据 
				var record = grid.getStore().getAt(rowIndex); 
				alert(record.data.company); 
			} 
		} 
	]); 
	treeMenu.showAt(e.getXY());  
}); 
```