如何一起使用 Ext.create
和 this.callParent
?如果我使用以下代码,从 ajax 存储检索数据时会出错。
items: [
{ xtype: 'combo',
initComponent: function() {
...
this.callParent(arguments);
}
}
]
有什么建议吗?
最佳答案
callParent
文档说:
Call the "parent" method of the current method. That is the method previously overridden by derivation or by an override (see Ext.define).
换句话说,你只能在 Ext.define
或 Ext.override
中获得 callParent;当您在配置中重写此方法时则不会。
真正需要理解的是,initComponent
并不意味着作为配置被覆盖。您确实应该扩展 combo
类并重写其中的 initComponent
。
关于javascript - Ext.Create 和 this.callParent,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15631027/