当前位置:编程学习 > JS >>

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

我遇到的这个错误原因是没有继承相应的类导致的,代码如下:
[javascript] 
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方法时因为没有引入类导致的

补充:web前端 , JavaScript ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,