2012-04-14 16 views
1

我想在頁面加載中間內容的具體高度(600像素等):ExtJS的獲得視後面板的高度

現在我有類似的東西:

[_ __ _ __ _ __ _ ___部首_ __ _ __ _ __ _ __ _ ___]

[左側邊欄] [中內容面板] [右側欄]

[_ __ _ __ _ __ _ ___頁腳_ __ _ __ _ __ _ __ _ ____]代碼

部分:

var viewport = new Ext.Viewport({ 
    layout: 'border', 
    id: 'parent_container', 
    items: [{ 
     region: 'north', 
     contentEl: 'header', 
     border: false 
    }, { 
     region: 'west', 
     id: 'left_sidebar_panel', 
     split: true, 
     width: 200, 
     minSize: 200, 
     maxSize: 400, 
     autoScroll: true, 
     contentEl: 'sidebar_container', 
     border: false 
    },{ 
     region: 'center', 
     id: 'middle_content_panel', 
     layout: 'border', 
     border: false, 
     items: [{ 
      region: 'north', 
      contentEl: 'main_content_header', 
      border: false 
    }... 

反正是有強制middle_content_panel在頁面加載/窗口上展開特定高度?或者用其他方式來用JavaScript來獲取它的高度。

回答

2

首先你要確定你的中心內容爲變量

For example: var center= new Ext.Panel({ 
... 
}); 

您可以使用自動調用setHeight方法center.setHeight(600);

從技術文檔:

enter image description here

相關問題