2012-08-12 3 views
5

나는 tabpanel을 가지고 있습니다. 이 탭에는 도구 모음과 [필드 세트, 격자 패널 및 다른 필드 세트 (또는 일부 버튼)]의 3 개 항목이 포함 된 패널이 있습니다. 스크롤바를 표시하기 위해 gridpanel을 가져올 수 없습니다. 그것은 단지 내가 gridheel의 maxheight/minheight을 설정하면 작동합니다.
또한 컨테이너 내부에 격자 패널을 배치하려고했습니다. 불운. 이 예에서는 맞는 레이아웃을 사용합니다. "앵커"레이아웃을 시도하고 anchor를 할당했습니다 : 브라우저의 크기를 조정할 때 크기가 조정되기를 기대하면서 gridpanel에 '100 % 50 %'. 불운.패널 내부의 extjs gridpanel이 자동 스크롤이나 크기 조정을하지 않습니다.

또는 gridpanel이 탭의 유일한 항목 인 경우 자동 스크롤이 작동합니다. 따라서 다른 패널 안에있을 때 자동 스크롤/크기 조정이 작동하지 않습니다.

내가 여기에 뭔가 못 찾았 니?

gridpanel의 상위 패널 fit 레이아웃이, 아직 1 개 이상의 항목 (fieldset에서는 상기 gridpanel, 다른 FIELDSET)가 있는지
Ext.application({ 
    name: 'MyApp', 
    launch: function() { 

     // create the data store 
     var d = ['company', 100]; 
     var myData = []; 
     for (var i = 0; i < 50; i++) { 
      myData[i] = d; 
     } 
     var store = Ext.create('Ext.data.ArrayStore', { 
      fields: [{ 
       name: 'company' 
      }, { 
       name: 'price', 
       type: 'float' 
      }], 
      data: myData 
     }); 

     Ext.create("Ext.container.Viewport", { 
      layout: { 
       type: 'border' 
      }, 
      items: [{ 
       xtype: 'toolbar', 
       id: 'headerbar', 
       region: 'north', 
       height: 30 
      }, { 
       xtype: 'toolbar', 
       id: 'menubar', 
       region: 'north', 
       height: 30 
      }, { 
       xtype: 'tabpanel', 
       itemId: 'maintabpanel', 
       activeTab: 0, 
       region: 'center', 
       plain: true, 
       margins: '5 5 5 5', 
       layout: 'fit', 
       items: [{ 
        closable: false, 
        title: 'Tab', 
        margins: '0 0 0 0', 
        items: [{ 
         xtype: 'panel', 
         title: 'Panel', 
         layout: 'fit', 
         tools: [{ 
          type: 'help', 
          tooltip: 'Help' 
         }, { 
          type: 'close', 
          tooltip: 'Close' 
         }], 
         items: [{ 
          xtype: 'fieldset', 
          title: 'Field Set', 
          layout: 'hbox', 
          items: [{ 
           xtype: 'textfield', 
           fieldLabel: 'Input' 
          }] 
         }, { 
          xtype: 'gridpanel', 
          autoScroll: true, 
          store: store, 
          columns: [{ 
           text: 'Company', 
           flex: 1, 
           sortable: true, 
           dataIndex: 'company' 
          }, { 
           text: 'Price', 
           flex: 1, 
           sortable: true, 
           dataIndex: 'price' 
          }], 
          viewConfig: { 
           autoFit: true 
          } 
         }, { 
          xtype: 'fieldset', 
          title: 'Field Set 2', 
          layout: 'hbox', 
          items: [{ 
           xtype: 'textfield', 
           fieldLabel: 'Output' 
          }] 
         }] 

        }] 
       }] 
      }, { 
       xtype: 'box', 
       id: 'footer', 
       region: 'south', 
       html: '<h1> Copyright 2012</h1>', 
       height: 30 
      }] 
     }); 
    } 
}); 
+0

문제 해결 방법을 찾으셨습니까? – Elias

답변

2

참고. fit 레이아웃에는 자식이 1 명만있을 수 있습니다.

또한 fit 패널의 부모 (closable : false - 탭이있는 패널)에는 레이아웃 정의가 없습니다.

다음은 작동하는 JsFiddle modified version of your code입니다.