Home  >  Article  >  Web Front-end  >  ExtJs grid row two methods of right-click menu_extjs

ExtJs grid row two methods of right-click menu_extjs

WBOY
WBOYOriginal
2016-05-16 18:25:031262browse

在这下边: 方法一

复制代码 代码如下:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gridContextMenu.aspx.cs" Inherits="gridContextMenu" %>



无标题页

















给 Extjs grid 加入右键菜单方法二。
复制代码 代码如下:

grid.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);
//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());
});
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn