2012-01-06 1 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

문제 :

당신은 패널 내에서 목록을 중첩된다. 그것을 unnest보십시오 :

코드 :

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