2012-01-06 8 views
4

TabPanelのタブ内にリストを表示しようとしています。リストを表示するだけでうまくいきますが、TabPanelの中​​に置くと表示されません。Sencha touch 2 - パネルまたはTabPanelの内部にリストをネストできません

それは私が打ち上げイベントでこのコードを使用するときに表示されます。

Ext.create('Ext.List', { 
      fullscreen: true, 
      itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>', 
      store: cityStore 
     }); 

そして、私はこのコードを使用する場合(タブが必要で示されているが)、それは表示されません。また、項目内にExt.createリストを含めてみましたが、これは同じ結果です。

 Ext.create('Ext.TabPanel',{ 
      fullscreen: true, 
      tabBarPosition: 'bottom', 
      scrollable: true, 
      items: [ 
       { 
        title: 'Home', 
        iconCls: 'home', 
        html: ['Welcome to my Pizza!'].join(""), 
        style: 'text-align: center;' 
       }, 
       { 
        title: 'Search', 
        iconCls: 'search', 
        items: [ 
          Ext.create('Ext.List', { 
           fullscreen: true, 
           itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>', 
           store: cityStore 
          }) 
        ] 
       }, 
       { 
        xtype: 'toolbar', 
        title: 'Pizza', 
        dock: 'top' 
       } 
      ] 
     }).setActiveItem(1); // this is set for debugging only 

何が間違っていますか?ありがとう!煎茶フォーラムで解決

答えて

5

問題:

あなたはパネル内のリストをネストされています。それをネスト解除するようにしてください:

コード:

Ext.create('Ext.tab.Panel',{ 
    fullscreen: true, 
    tabBarPosition: 'bottom', 
    scrollable: true, 
    items: [ 
     { 
      title: 'Home', 
      iconCls: 'home', 
      html: ['Welcome to my Pizza!'].join(""), 
      style: 'text-align: center;' 
     }, 
     { 
      xtype: 'list', 
      title: 'Search', 
      iconCls: 'search', 
      store: cityStore, 
      itemTpl: '<div class="contact">{ID} <strong>{Name}</strong></div>' 
     }, 
     { 
      xtype: 'toolbar', 
      title: 'Pizza', 
      dock: 'top' 
     } 
    ] 
}).setActiveItem(1); 
+1

あなたは '非公開に' それを説明していただけますか?私もこれを達成しようとしています。 –

+0

リストをタブ自体のように置く必要があります。 – Carlos

関連する問題