【发布时间】:2016-10-10 10:25:10
【问题描述】:
我有一个网格,并且在网格上下文菜单上我正在调用一个函数,如下所示-
在网格上下文菜单中,我添加了以下项目
{ text: 'Preview', handler: 'PreviewGrid', scope: cnt, };
在控制器中-
previewGrid: function (contextMenuItem) {
// Here I am getting the item i.e. contextmenu item.
// But I want here is grid on which there was right click
}
我尝试使用item.ownerCt.up('grid')
但它不起作用。
任何帮助将不胜感激。
【问题讨论】:
-
我没有看到您的代码在哪里以及如何实例化上下文菜单,但是为什么您在该过程中删除了参数,然后又来寻求我们的帮助以再次检索它们? ExtJS 自己的
itemcontextmenu ( this , record , item , index , e , eOpts )event 正在提供所需的信息。 -
我这样做了,但我无法在其中获得网格。添加菜单项时我做错了吗?
-
你的问题没有意义,这里没有上下文。
标签: javascript extjs grid contextmenu extjs6