我在创建上下文菜单时出现问题(右键单击)。有人可以帮我处理代码吗?
我的代码:
var item = RMenu.add({
text: '$Delete',
id: 'Delete',
icon:'../Tce/Images/tcdtpDelete.gif',
handler:onItemClick,
tooltip:'$Delete'
});
答案 0 :(得分:1)
listeners: {
cellcontextmenu: function(table, td, cellIndex, record, tr, rowIndex, e) {
Ext.create('Ext.menu.Menu',{
items:[{
text: 'Delete',
handler: function() {
table.getStore().remove(table.getSelectionModel().getSelection());
table.getStore().sync();
}
}]
}).showAt(e.pageX, e.pageY);
}
}