我的js结构是这样的,我的问题是在window_searchFile中药如何调用refresh这个方法
[code="java"]
FileGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
......
refresh : function(){
this.getStore().reload();
},
......
searchFile : function() {
var window_searchFile = new Ext.Window({
......
//请问我在这个里面要如何调用refresh这个方法
})
}
})
[/code]
我没有看清问题 你要在window里面调用 refresh方法 应该通过button的调用
searchFile : function() {
var self = this;
var window_searchFile = new Ext.Window({
buttons:[{
text:'sdf',
handler:function(){
self.refresh();
}
}]
})
}
测试过 没有问题
可以在里面加一个self属性 赋值 this
这样就可以保持对父类的引用
在需要使用父类的时候 使用self来访问
FileGridPanel = Ext.extend(Ext.grid.EditorGridPanel, {
......
self:this,
refresh : function(){
this.getStore().reload();
},
......
searchFile : function() {
var window_searchFile = new Ext.Window({
......
self.refresh();
//请问我在这个里面要如何调用refresh这个方法
})
}
})