我想所有gridpanel都有selectionchange事件;ExtJs4如何将默认事件添加到GridPanel
因为我在一个页面中有一些网格,我需要get currentGrid来做一些事情;
如:
VAR activeGrid
selectionchange:function(){
activeGrid = this;
}
然后我就可以得到currentGrid。谢谢
我想所有gridpanel都有selectionchange事件;ExtJs4如何将默认事件添加到GridPanel
因为我在一个页面中有一些网格,我需要get currentGrid来做一些事情;
如:
VAR activeGrid
selectionchange:function(){
activeGrid = this;
}
然后我就可以得到currentGrid。谢谢
Ext.override('Ext.grid.Panel', {
initComponent: function(config) {
this.callOverridden(arguments);
this.on({
selectionchange: this.mySelectionFunction,
scope: this
});
},
mySelectionFunction: function() {
// Do your stuff here
}
});
你需要一些解释吗?
看看这个问题:How to Perform Controller Inheritance in ExtJS 4?
我张贴有关如何在视图中创建的基本功能/控制器的一些例子。我想你会找到你要找的。
哇......这将改变selectionchange甚至可以在你的应用程序的所有网格面板中工作。我不认为这是OP所期望的。 – sha 2012-04-11 12:37:19
@sha“我想所有gridpanel都有选择变更事件;”。我认为所有人都是“全部”。 – Nameless 2012-04-12 06:24:36