0

I have following code

grid.on('contextmenu', this.onContextMenu, this);

onContextMenu: function (e) {
      // I want the grid here
    },

there is only one argument 'e'. I cannot use 'this' as the grid is inside panel and 'this' returns panel not the grid. I am using Extjs 2.3.0.

4

1 回答 1

0

您可以自己将网格传递给您的处理程序:

grid.on('contextmenu', function(e) {
    this.onContextMenu(e, grid);
}, this);

您的处理程序方法:

onContextMenu: function(e, grid) {
    // have fun with your grid
}
于 2013-05-30T14:09:52.873 回答