Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
次のコードがあります
grid.on('contextmenu', this.onContextMenu, this); onContextMenu: function (e) { // I want the grid here },
引数 'e' は 1 つだけです。グリッドはパネル内にあり、「this」はグリッドではなくパネルを返すため、「this」は使用できません。Extjs 2.3.0 を使用しています。
グリッドをハンドラーに自分で渡すことができます。
grid.on('contextmenu', function(e) { this.onContextMenu(e, grid); }, this);
あなたのハンドラメソッド:
onContextMenu: function(e, grid) { // have fun with your grid }