2014-02-11 57 views
1

我在ExtJS 4.2.2中的邊框佈局中的面板項目中存在可摺疊面板的問題。 Basiclly它的結構如下:ExtJS 4.x中的邊框佈局中的面板崩潰時出現問題

Ext.onReady(function() { 

var panel = Ext.create('Ext.panel.Panel', { 
    height: 400, 
    width: 600, 
    title: 'TestPanel', 
    renderTo: Ext.getBody(), 
    items: [ 
    { xtype: 'toolbar', items: [{xtype: 'button', text: 'test1'}, {xtype: 'button', text: 'test2'}, {xtype: 'button', text: 'test3'}]}, 
    { 
     xtype: 'panel', 
     items: [ 
      { xtype: 'toolbar', items: [{xtype: 'button', text: 'another1'}, {xtype: 'button', text: 'another2'}, {xtype: 'button', text: 'another3'}]}, 
     { 
      xtype: 'panel', 
      layout: 'border', 
      height: 600, 
      width: 200, 
      items: [ 
      {xtype: 'panel', title: 'options', html: 'lalalalalalalalalala', region: 'west', width: 100, height: 100, collapsible: true, collapsed: true}, 
      {xtype: 'panel', html: 'lalalalalalalalalala', region: 'center', width: 100, height: 100} 
      ] 
     } 

     ] 
    } 
    ] 
}); 
}); 

下面是相應的小提琴: http://jsfiddle.net/jLugR/

當你uncollapse選項面板一切工作正常。當你再次摺疊它時,它會破壞佈局。你有什麼想法是什麼問題以及如何處理它?

+1

我建議在Sencha論壇中打開一個錯誤報告:http://www.sencha.com/forum/forumdisplay。 php?80-Ext-Bugs –

+0

Newmount提供了一個解決方案如何避免這個錯誤,但我已經在Sencha論壇上報告過它。我希望他們能儘快修復:) –

回答

2

看起來像子面板的(邊框佈局)高度超過了父面板的高度。確保所有子元素的高度不超過父母高度。 通過將邊框佈局的面板高度更改爲250來檢查小提琴,它的工作原理是......

+0

非常感謝。調整身高屬性解決了我的問題。 這仍然是extjs的一些奇怪行爲。 –