EXT Grid 右键多级菜单
来源:互联网 发布:云计算技术及应用 编辑:程序博客网 时间:2024/05/16 07:41
//绑定右键弹出事件
Ext.getCmp("StuList").on("rowcontextmenu", open_rowcontextmenu); //StuList指的是GridPanel的Id
//右键菜单事件
function open_rowcontextmenu(grid, rowIndex, e) {
e.preventDefault();
grid.getSelectionModel().selectRow(rowIndex); //右键选中某行
// 定义右键菜单
var menus = new Ext.menu.Menu
([
{
xtype: "", text: "智育成绩", icon: '../images/button/add.gif',
menu: new Ext.menu.Menu([
{ xtype: "", text: '录入成绩', icon: '../images/button/add.gif', handler: function () { Edit(grid, rowIndex, e, "录入成绩A"); } },
{ xtype: "", text: '编辑成绩', icon: '../images/button/edit.gif', handler: function () { Edit(grid, rowIndex, e, "编辑成绩A"); } }
])
},
{
xtype: "", text: "德育成绩", icon: '../images/button/add.gif',
menu: new Ext.menu.Menu([
{ xtype: "", text: '录入成绩', icon: '../images/button/add.gif', handler: function () { Edit(grid, rowIndex, e, "录入成绩B"); } },
{ xtype: "", text: '编辑成绩', icon: '../images/button/edit.gif', handler: function () { Edit(grid, rowIndex, e, "编辑成绩B"); } }
])
},
{
xtype: "", text: "删除成绩", icon: '../images/button/del.gif',
handler: function () { Edit(grid, rowIndex, e, "删除成绩"); }
}
]);
menus.showAt(e.getPoint());
}
function Edit(grid, rowIndex, e, titleInfo) {
if (titleInfo == "录入成绩A") {
//添加代码
}
if (titleInfo == "编辑成绩A") {
//添加代码
}
if (titleInfo == "录入成绩B") {
//添加代码
}
if (titleInfo == "编辑成绩B") {
//添加代码
}
}
实现效果
- EXT Grid 右键多级菜单
- Ext之grid右键菜单
- Ext之grid右键菜单
- 多级右键菜单
- 多级右键菜单 JS
- ext 右键菜单
- Ext desktop桌面菜单右键
- Ext Tree 添加右键菜单
- Ext 4.2 添加右键菜单
- 用popup实现右键多级菜单
- 极酷的多级右键菜单
- 极酷的多级右键菜单
- js实现右键弹出多级菜单特效
- 注册表实现右键自定义多级菜单
- COM组件实现右键自定义多级菜单
- wpf多级动态右键菜单ContextmMenu
- [GXT]向Grid控件添加右键菜单.
- 给 Extjs grid 加入右键菜单。
- MyEclipse常用设置
- jvm
- 静态构造函数
- netty 过长内容分成了多次发送 问题 LengthFieldBasedFrameDecoder使用
- 五大Android布局方式浅析
- EXT Grid 右键多级菜单
- 免费edu邮箱申请注册地址
- “NOR flash 程序可在芯片内执行”-很操蛋的一句话
- 64bit win7 oracle11gR2 installation
- 什么是C/S架构B/S架构
- apache 设置禁止访问某些文件或目录
- gsettings
- 水晶报表中"已达到系统管理员配置的最大报表处理作业数限制"错误的处理 .
- POJ1990 MooFest——树状数组