View Full Version : Grid won't auto size with panel

13 Sep 2010, 6:18 PM
Greetings, and sorry if there is already a thread for this issue but I couldn't find the answer to my problem.

I have a viewport with a border layout and I'm rendering a grid in the center region and I want it to autosize to the panel in the region. I can observe (using firebug) that the width and height of the panel changes with the size of the viewport but the grid does not resize to the panel. If I don't specify any size or scrolling attributes on the grid (I read that you don't want to do this for autosizing) then the grid width initially sizes with the panel but the height is 1 row only along with title bar, top bar etc. I can specify a fixed height for the grid to show more rows but I really want it to autosize the height. Also I can't grab the right side and drag it wider like I can with another App I did that uses a border layout in window as opposed to the viewport. Maybe its cuz in this case I don't add the grid to the center region till after the layout is rendered. I dunno.

Heres the config bits...what am I doing wrong:-/

contentRegion: {

region : "center",
id : "main-content-region",
height: '100%'

this.viewport = new Ext.Viewport(
layout : "border",
items: [this.headerRegion, this.footerRegion, nav, this.contentRegion]


center region may or may not have content when adding panelgrid...

center = Ext.getCmp('main-content-region');

Thats it, but apparently not sufficient to get the grid to render properly.

14 Sep 2010, 12:25 AM
1. The center region shouldn't have a height. The border layout of the container automatically assigns a height.
2. The center region doesn't have a layout, so how should it size the grid you are adding? (try layout:'fit').