2011-05-12 79 views

回答

2

試試這個代碼:

 

Ext.regApplication({              
    name : 'MyApp',             
    launch : function(){ 
     window.localStorage.clear(); 
     new MyApp.MainTabPanel({            
      fullscreen : true 
     }); 
    } 
}); 

MyApp.MainTabPanel = Ext.extend(Ext.TabPanel,{ 
    fullscreen: true,  
    tabBar: { 
     dock: 'bottom', 
     scroll: 'horizontal', 
     sortable: true, 
     layout: { 
      pack: 'center' 
     } 
    }, 
    cls: 'card1', 
    html: '', 
    items: [ 
     { iconCls: 'time', title: 'Time', xtype: 'TimeTabPanel'}, 
     { iconCls: 'user', title: 'People', xtype: 'PeopleTabPanel' } 
    ] 

}); 

Ext.reg('MainTabPanel',MyApp.MainTabPanel); 

MyApp.PeopleTabPanel = Ext.extend(Ext.TabPanel,{ 
    fullscreen: true,  
    tabBar: { 
     dock: 'top', 
     scroll: 'horizontal', 
     sortable: true, 
     layout: { 
      pack: 'left' 
     } 
    }, 
    cls: 'card1',  
    items: [ 
      { iconCls: 'user', title: 'Man' , html: 'MAN TAB'}, 
      { iconCls: 'user', title: 'Woman', html: 'WOMAN TAB' } 
    ] 

}); 
Ext.reg('PeopleTabPanel',MyApp.PeopleTabPanel); 

MyApp.TimeTabPanel = Ext.extend(Ext.TabPanel,{ 
    fullscreen: true,  
    tabBar: { 
     dock: 'top', 
     scroll: 'horizontal', 
     sortable: true, 
     layout: { 
      pack: 'left' 
     } 
    }, 
    cls: 'card1',  
    items: [ 
      { iconCls: 'time', title: 'AM', html: 'AM TAB' }, 
      { iconCls: 'time', title: 'PM', html: 'PM TAB' } 
    ] 

}); 
Ext.reg('TimeTabPanel',MyApp.TimeTabPanel); 


相關問題