您的位置:首页 > 其它

Ext.grid.EditorGridPanel点击单元格添加菜单栏

2013-09-06 10:32 429 查看
1、定义菜单栏需要的全局变量

var khbm;
var type;


2、新建一个菜单栏

var smenu = new Ext.menu.Menu({
id:"sMenu",
items:[{
text:"追溯",
handler:function(){
          //此处添加操作             }
}]
});


3、为gird添加点击监听事件,并且添加菜单栏

listeners:{
'cellclick':function(grid, rowIndex, columnIndex, e){
var record = grid.getStore().getAt(rowIndex);
var fieldName = grid.getColumnModel().getDataIndex(columnIndex);
khbm = record.get("khbm");//客户编码
type = record.get("type");//产品型号
if(fieldName=="查看"){
sourceMenu.showAt(e.getXY());
}
}
}


最后效果如下:

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: