2011-09-25 38 views
0

因此,我剛剛開始與Sencha Touch合作。我想在TabPanel中包含一個列表,但由於某種原因,它不起作用。請幫忙。謝謝!Sencha Touch-- TabPanel中的列表無法正常工作

HTML:

<!DOCTYPE html> 
<html> 
<head> 
    <title>Hello World</title> 
    <script src="lib/touch/sencha-touch.js" type="text/javascript"></script> 
    <script src="app/app.js" type="text/javascript"></script> 
    <script src="app/rosterData.js" type="text/javascript"></script> 
    <link href="lib/touch/resources/css/sencha-touch.css" rel="stylesheet"type="text/css" /> 
    <link href="app/myAppStyle.css" rel="stylesheet" type="text/css" /> 

</head> 
<body></body> 
</html> 

的Javascript:

MyApp=new Ext.Application({ 
name: 'MyApp', 
launch: function() { 

    MyApp.tabbedView= new Ext.TabPanel({ 
     cardSwitchAnimation: 'slide', 
     tabBar: { 
      dock: 'bottom', 
      layout: { 
       pack: 'center' 
      } 
     }, 
     items: [{ 
      title: "Schedule",    
      cls: 'card', 
      iconCls: 'time', 
      style: "background-color: #000", 

     }, 
     { 
      title: "Roster", 
      layout: 'fit', 
      cls: 'card', 
      iconCls: 'team',     
      xtype: 'list', 
      store: MyApp.RosterStore, 
      itemTpl: '<div class="contact"><strong>{firstName}</strong> {lastName}</div>' 
      style: "background-color: #aaa", 
     }, 
     { 
      title: "Info", 
      html: "Bye", 
      cls: 'card homeScreen', 
      iconCls: 'info', 
      style: "background-color: #aaa", 
     } 
     ] 


    }); 
    Ext.regModel('PlayerName', { 
     fields: ['firstName', 'lastName'] 
    }); 
    MyApp.RosterStore= new Ext.data.Store({ 
     model: 'PlayerName', 
     data: [ 
      {firstName: "Shivam", lastName: "Thapar"}, 
      {firstName: "Last", lastName: "First"}, 
      {firstName: "Bob", lastName: "Smith"} 
     ] 
    }); 


    MyApp.Viewport= new Ext.Panel({ 
     fullscreen: true, 
     layout: 'fit', 
     style: "background-color: #fee", 

     items: [MyApp.tabbedView] 

    }); 
} 
}); 
+0

當我拿出店裏,regModel和列表(在其中一個選項卡列表中的東西),它運行。隨着東西,屏幕是完全空白的... –

+0

沒關係,我想通了我的問題。以另一個名稱XP稱爲商店 –

回答

0

嘗試把定義的TabPanel上述模型和存儲的定義。

型號第一 商店旁邊 然後的TabPanel

相關問題