PDA

View Full Version : GridPanel Grid width



manxomfoe
1 Nov 2006, 3:20 PM
When I'm adding a grid to a BorderLayout, via a GridPanel, I'm pretty sure that you programatically know exactly how wide the panel is, as it's calculated as part of the layout. If you know how wide the panel is, then how can you bind the specified width of the grid to the width of the panel, thereby making it "appear" to stretch with the panel?

I'm trying to get my grid to utilize it's smart auto-sizing to give a column with a lot of long descriptive text the most room it can have inside the panel without triggering horizontal scrolling.

How would you go about connecting the two values together so that it re-sizes the actual grid (in the GridPanel) to the width of the panel?

Thanks,

jarrod
1 Nov 2006, 7:10 PM
Check out: http://www.jackslocum.com/forum/viewtopic.php?t=418

Essentially, what you may want to do is to hook into the grid autoSize(), as well as 'columnresize' event to call fitColumns() automatically.

jack.slocum
1 Nov 2006, 9:45 PM
You may also want to look at http://www.jackslocum.com/blog/examples/PropsGrid.js it overrides the grid's autoSize() method and makes the appropriate call to fitColumns()