View Full Version : Grid Resize in IE6 / IE7

5 Mar 2008, 8:31 AM

I would like to add a GridPanel to a div and have that GridPanel resize with the window. In FF2 it works fine.

In IE6 / IE7 the Grid will only resize when enlarging the window and not when making the window smaller.

I realize this issue has been addressed many times here in the forum. I have looked at several of the posts and unfortunately not been able to find a working solution. One solution can be found here: http://extjs.com/forum/showthread.php?t=26051&highlight=resize+smaller+grid but this solution is only valid if you use a ViewPort and not a single div.

The below code illustrates the problem: (I am putting the grid inside a TabPanel in this example but the same problem arises for standalone GridPanels)

var ds = new Ext.data.SimpleStore({
fields: ['field1', 'field2', 'field3' ]

var colModel = new Ext.grid.ColumnModel([
{id:'field1', dataIndex:'field1', header:'field1', width: 33},
{id:'field2', dataIndex:'field2', header:'field2', width: 33},
{id:'field3', dataIndex:'field3', header:'field3', width: 33}

// create the Grid
var grid = new Ext.grid.GridPanel({
store: ds,
cm: colModel,
title:'Grid Panel',
viewConfig: {
forceFit: true
autoWidth: true

var panel = new Ext.TabPanel({
activeTab: 0,
items: grid


Any suggestions would be highly appreciated.

5 Mar 2008, 9:24 AM
How is the render target ('test') styled? Does it track the browser window size?

Give the tabPanel some help:

var panel = new Ext.TabPanel({
activeTab: 0,
items: grid

6 Mar 2008, 12:35 AM
Thanks hendricd,

I have no styling on the "test" div. And as I recall using percentages in ExtJS height and width configuration objects is not allowed. Any other suggestions?

6 Mar 2008, 2:19 AM
Check this, but I'm not sure it is what you need


6 Mar 2008, 8:48 AM
Thank you so much! =D> That seems to be exactly what I needed. Excellent plugin by Condor.

7 Mar 2008, 5:25 AM
The resizing seems to work ok, but the refresh rate of the grid is not so good. For example I would resize the window and the grid will lag for a second or two before it resizes with the window. This means that it still breaks the layout in IE6 and IE7 unfortunately :s Can somebody please give some advise?