cannot read property 'items' of undefined

今天在自定义类时出现这样一个错误,经过反复尝试和仔细阅读api后发现,我的自定义类继承了Ext.panel.Panel,并实现了initComponent方法,问题在于我的initComponent方法中没有调用callParent()。

API文档中关于initComponent()有这样一段话:“The initComponent method must contain a call to callParent in order to ensure that the parent class' initComponent method is also called.”

在initComponent()的最后添加this.callParent()后问题解决

你可能感兴趣的:(undefined,ExtJs,initComponent)