Results 1 to 2 of 2

Thread: sizing a grid to an explicit number of rows

  1. #1
    Ext JS Premium Member
    Join Date
    Aug 2010
    Posts
    25

    Default sizing a grid to an explicit number of rows

    I'm trying to size a grid based on the desired number of rows (page size).

    Currently I have the grid set to autoHeight = true.

    I limit my result set to 10 records per page. This works fine if my search results in more than 10 records.

    However, when less than 10 records come back (say 2 for example) my grid only has a height for 2 rows.

    I'm wondering if there is a way to explicitly size the grid to 10 records. I'm hesitant to estimate based on pixels as I think this will be harder to maintain and could lead to cross-browser rendering issues.

    I'm also letting the user choose their page size and storing this in a cookie. So, I can't just set the grid height to a static value.

  2. #2
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,246

    Default

    After rendering the rows, you can query the height of the mainBody, add the height of the header and padding and use this to set the height of the grid.

Similar Threads

  1. Replies: 1
    Last Post: 10 Sep 2010, 2:10 AM
  2. Minimum number of rows in a grid
    By edumrf in forum Ext GWT: Discussion
    Replies: 5
    Last Post: 8 Jul 2009, 4:13 AM
  3. Minimum number of rows in a grid
    By INeedADip in forum Ext 1.x: Help & Discussion
    Replies: 10
    Last Post: 7 Jul 2009, 10:10 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •