我想弄清楚为什么callParent不工作。ExtJS 4 callParent不工作
下面是一些代码:
Ext.define('AM.ArView', {
extend:'Ext.window.Window',
initComponent: function() {
var foo = this;
console.log(foo);
Ext.Ajax.request({
url: 'http://my/awesome/path',
success: function(response, opts) {
console.log(foo);
foo.callParent();
},
failure: function(response, opts) {
console.log('error');
}
});
}
});
错误: 遗漏的类型错误:无法读取的不确定
我需要通过AJAX
无论如何,一个解决方案是进行同步调用。 – 2012-02-13 14:34:23
这样截获initComponent是非常奇怪的。我建议为此使用特殊事件。 – knalli 2012-09-28 21:19:03
这并不奇怪,异步呼叫是可能的和非常合理的,请参阅下面我的答案。 – Tom 2013-05-05 11:56:40