日期:2014-05-16  浏览次数:20316 次

Extjs4---Uncaught TypeError: Cannot call method 'apply' of undefined

我遇到的这个错误原因是没有继承相应的类导致的,代码如下:

Ext.define(
		'SMS.view.TabPanel',
		{
			//extend:'Ext.tab.Panel',//因为没有继承类导致的
			initComponent:function(){
				Ext.apply(
						this,
						{
							id:'content-panel',
							region:'center',
							defaults:{
								autoScoll:true,
								bodyPadding:10
							},
							activeTab:0,
							border:false,
							items:[
							       {
							    	   id:'HomePage',
							    	   title:'首页',
							    	   layout:'fit'
							       }
							]
						}
				);
				this.callParent(arguments); 
			}
		}
);

在谷歌浏览器中的错误如下:


我们可以看到在调用callParent方法时因为没有引入类导致的