-
16 Oct 2006 4:01 PM #1
Adjusting height of grid container
Adjusting height of grid container
I'd like to be able to adjust the height of the grid container to fit the number of rows returned from a query (JSON). I've added the code in an onLoad handler which includes:
This works correctly, except that when the column widths are adjusted the horizontal scroll bar is not visible (if the new height is less than the default height of the container).Code:// set the height for the number of rows + the header height + room for scrollbar (i.e. rows*21px + 52px) var ht = 52 + this.dataModel.getRowCount()*21; YAHOO.util.Dom.setStyle('my-grid', 'height', '' + ht + 'px');
Also, if the default height of the container is too small for the number of rows then only the number of rows that can fit in the original height are displayed and no vertical scrollbar is displayed.
Obviously I'm missing something vital, so what is the correct way to adjust the height of the container so that the scroll bars work and all the rows fit correctly?
-
16 Oct 2006 4:06 PM #2
Call grid.autoSize() after adjusting the size of the container. It will automatically adjust everything to fit the grid to the container.
-
16 Oct 2006 4:28 PM #3
Similar Threads
-
Grid height at 100% in IE7
By alindsay55661 in forum Ext 2.x: Help & DiscussionReplies: 7Last Post: 1 Aug 2008, 5:59 AM -
Help with Grid Row Height
By timothyf in forum Ext 1.x: Help & DiscussionReplies: 0Last Post: 28 Feb 2007, 1:32 PM -
Tree height container
By pomata in forum Ext 1.x: Help & DiscussionReplies: 1Last Post: 9 Jan 2007, 12:52 PM -
how to get grid object from the container div.
By sayeed in forum Community DiscussionReplies: 7Last Post: 26 Dec 2006, 7:43 PM -
getting grid data if we know container div
By sayeed in forum Community DiscussionReplies: 2Last Post: 26 Dec 2006, 3:51 AM


Reply With Quote