1. #1
    Ext User
    Join Date
    Mar 2007
    Posts
    12
    Vote Rating
    0
    robert is on a distinguished road

      0  

    Default 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:

    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');
    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).

    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?

  2. #2
    Sencha User jack.slocum's Avatar
    Join Date
    Mar 2007
    Location
    Tampa, FL
    Posts
    6,955
    Vote Rating
    16
    jack.slocum will become famous soon enough

      0  

    Default


    Call grid.autoSize() after adjusting the size of the container. It will automatically adjust everything to fit the grid to the container.

  3. #3
    Ext User
    Join Date
    Mar 2007
    Posts
    12
    Vote Rating
    0
    robert is on a distinguished road

      0  

    Default


    Perfect!

    Thanks a lot.

Similar Threads

  1. Grid height at 100% in IE7
    By alindsay55661 in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 1 Aug 2008, 5:59 AM
  2. Help with Grid Row Height
    By timothyf in forum Ext 1.x: Help & Discussion
    Replies: 0
    Last Post: 28 Feb 2007, 1:32 PM
  3. Tree height container
    By pomata in forum Ext 1.x: Help & Discussion
    Replies: 1
    Last Post: 9 Jan 2007, 12:52 PM
  4. how to get grid object from the container div.
    By sayeed in forum Community Discussion
    Replies: 7
    Last Post: 26 Dec 2006, 7:43 PM
  5. getting grid data if we know container div
    By sayeed in forum Community Discussion
    Replies: 2
    Last Post: 26 Dec 2006, 3:51 AM

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar