View Full Version : How can a grid panel expand height for additional rows, then scroll art a max height?

11 Sep 2010, 1:07 PM
I've not tried it yet but not sure I know the parameters to use, as a best practice.
I need a grid that has a min height, then expands to a max height, from there will scroll to show more rows.

Is that all built into the functionality of the grid panel? (boxMinHeight, boxMaxWidth)

I assume so, but then I read the Warning in the API Docs, that these settings override the layout manager, and I'm using a border layout so not sure I want to override the layout manager. If the grid is in the center panel, can I set the grid to fit and let the center panel dictate these min/max values (like min 400px, max 600px)? I don't see how, since only the grid would know when it needs to start actually scrolling based on it's own settings, not enclosing containers, I assume. That spells "fit" to me, or "boxMin/Max" I think.

I think it general this is where Ext layout gets hairy because I can imagine at least 3 different ways to do this, but have no idea if there is generally accepted best practice, vs whatever I might hack together. Because I also consider the possibility of intermediate containers that might actually deal with the sizing as well, but of course it would be best to avoid that I think.

I can just see trying to hack this and being wrong as far as new 3.0 features, best practices, etc.
Thanks for any clues or references to examples that do this kind of sizing.

12 Sep 2010, 8:33 AM
GridView doesn't support this by default (as you've noticed).

The only way to do this is to get the height of the gridview scroller after adding rows (or deleting rows, changing row heights etc.), add header and border heights and set the height of the grid to this value (or the max. height if it would become to large).