View Full Version : Bets way to auto resize grid width without Viewport

14 May 2009, 5:51 AM
Not intending to use full Viewport in a complex page unless necessary.

Basically, the grid width is set using clientWidth property.
Some columns are set using width:200 for example. One of the columns have auto expand so it occupies the full width as such.

Can this be made to auto adjust if the window is minimized or manually resized, without using the viewport to change the full layout?

I see that the grid width remains fixed, even though autoWidth:true...


14 May 2009, 6:02 AM
you can listen to the window's resize event to figure out how to resize the grid.

14 May 2009, 7:17 AM
Is there no default implementation/setting to handle this?
Any examples to calculate the column width?
The last col out of 5 is actually auto expand, but how much to resize that to shrink so that it still covers the client width....

Can this be made as simple as specifying width in %..

Grid renders to a specific div...would the window resize event be called...

Thanks again!

14 May 2009, 2:20 PM

This has to be defined outside the onReady?

Do I need to change column model from the grid and will that reflect automatically?


15 May 2009, 12:47 PM
The grid renders on a div and using doLayout on the GridPanel in the resize event of windows doesn't work...

Seen lots of stuff, but in the end seems Viewport is the way to go?

2 Mar 2010, 1:52 PM
I just spend some time figuring this one out. When not in a Viewport, the browser window resize event needs to be passed along to the Ext JS component that is rendered to a div in your page. See my answer on stackoverflow (http://stackoverflow.com/questions/2366211/is-there-any-way-to-get-an-extjs-gridpanel-to-automatically-resize-its-width-but).