如何扩展Ext.tab.Panel

时间:2012-02-23 08:24:44

标签: extjs4

我正在为我的新项目玩ExtJS 4。我正在使用MVC架构并将widget用于其他组件。

问题是我无法为Ext.tab.Panel创建实例。这是我的代码

app.js

Ext.Loader.setConfig({   enabled: true });
Ext.application({   
        name: 'FBSPAM',   
        autoCreateViewport: false,   
        appFolder: 'app',   
        controllers: ['Users'],   
        launch: function(){       
              Ext.create('Ext.container.Viewport', {        
                   layout: 'border',       
                   title: 'App',        
                   items: [
                          {                
                               region: 'west',                
                               title: 'Menu',                
                               width: 250,                
                               xtype: 'accordionmenu'            
                          },
                          {                
                               region: 'center',                
                               xtype: 'tab'               
                              //items: tabpanel            
                           }        
                     ]    
               });
         }
});  

查看/ Tab.js

Ext.define('FBSPAM.view.Tab',{   
       extend: 'Ext.tab.Panel',   
       alias: 'widget.tab',   
       height: '100%',   
       layout: 'fit',   
       border: false,   
       initComponent: function(){      
            this.items = [          
                  {
                        title: "Hello",
                        html: "Hello World"           
                   }                  
            ];              
            this.callParent(arguments);   
      }
}); 

错误讯息:

Uncaught RangeError: Maximum call stack size exceeded  

1 个答案:

答案 0 :(得分:0)

那是因为你使用了别名。将alias: 'widget.tab'更改为其他内容(例如widget.tab2),它会起作用。

相关问题