我怎样才能使用Ext.create和this.callParent在一起?如果我使用以下代码,我将从 ajax 存储中检索数据时出错。
items: [
{ xtype: 'combo',
initComponent: function() {
...
this.callParent(arguments);
}
}
]
有什么建议么?
我怎样才能使用Ext.create和this.callParent在一起?如果我使用以下代码,我将从 ajax 存储中检索数据时出错。
items: [
{ xtype: 'combo',
initComponent: function() {
...
this.callParent(arguments);
}
}
]
有什么建议么?
callParent文档说:
调用当前方法的“父”方法。这是先前被派生或被覆盖覆盖的方法(参见 Ext.define)。
换句话说,您只能在 or 内获得Ext.definecallParent Ext.override;当您在配置中覆盖此方法时不会。
真正重要的是要理解它initComponent并不意味着作为配置被覆盖。你真的应该扩展combo类并initComponent在那里覆盖。
我的方法是在侦听器配置中使用boxReady事件。
Ext.create('...', {
listeners: {
boxReady: function() {
//Do something with this...
}
}
}