Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: GridPanel's maxHeight and autoHeight config options?

  1. #1

    Default GridPanel's maxHeight and autoHeight config options?

    Hi,

    I try to use GridPanel's maxHeight and autoHeight config options but it doesn't work.
    I found a post on forum about this problem, but it wasn't resolved. Maybe now it's a solution of this problem ?

    I'll be really grateful for help.

    Robert.

  2. #2

  3. #3

    Default

    I'm sorry. Maybe I wasn't clear.

    I try to create grid

    Code:
        var grid = new Ext.grid.GridPanel({
            store: store,
            columns: columns
            maxHeight:350,
            autoHeight: true
        });
    but GridPanel's config options maxHeight and autoHeight doesn't work (I can't create auto height grid with max height config option). I found a post on forum with the same problem but it wasn't resolved. Maybe now someone know how to resolve it?

    Robert.

  4. #4
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    Well, how high do you want the Grid to be?

  5. #5

    Default

    I want to create a grid which height will be set automatically
    Code:
    autoHeight:true
    ,but no more than 350px
    Code:
    maxHeight:350
    I thought that if I use this two config options I'll have the grid:
    1. For few records - grid's height will be set automatically for example (5 records - height 50px, 10 records - height 100px) - but no more than 350px
    2. For many records (for example 1000) - grid's height will be set on 350px and grid will have scrollbar so that I can see all of records.

    Now it's no matter if I have 5 or 1000 records grid's height is always set automatically so it looks that maxHeight config option doesn't work. There is a description in API Documentation:
    Code:
    maxHeight : Number 
    Sets the maximum height of the grid - ignored if autoHeight is not on.
    about this config option and it looks that it's possible to use it and it should be set with autoHeight config option.

    Maybe I don't understand this config options and I try to do something that it's impossible, so I'll be really grateful for the explanation.

    Thanks for help.

    Robert.

  6. #6
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    The GridPanel scrolls it's contents. It must be told how high to make itself.

    You can probably postprocess it after it loads and adjust the height, but what's the point? It would create an ugly application. Aren't you using a Viewport with fluid page design?

  7. #7

    Default

    No I don't use Viewport with fluid page design.

    I want to create GridPanel and Panel on my page, so I did something like this:

    Code:
        var grid = new Ext.grid.GridPanel({
            store: store,
            cm: cm,
            title:'Grid',
            width:600,
            height: 350,
            renderTo: 'grid'
        });
    
        var panel = new Ext.Panel({
        title: 'Panel',
        width: 600,
        height: 350,
        html: 'content'
        renderTo: 'panel',
        });
    and everything is ok if I have enough grid's records (attachement 1).
    If I have few records I have a lot of free space - (attachment 2). I don't want to use autoHeight config option because if I have a lot of records my grid is very long (attachement 3), but the problem is resolved when I have a few records.

    I thought that authoHeight and maxHeight config options are the best solution, but it doesn't work or I don't know how to use it.

    So my question is when can I use maxHeight config option and what is it's destination?


    Robert.
    Attached Images Attached Images
    • File Type: jpg 1.jpg (42.6 KB, 65 views)
    • File Type: jpg 2.jpg (25.0 KB, 54 views)
    • File Type: jpg 3.jpg (68.8 KB, 48 views)

  8. #8

    Default

    Any idea?

  9. #9
    Sencha User carol.ext's Avatar
    Join Date
    Jun 2007
    Location
    Littleton, Colorado, USA
    Posts
    707

    Default

    Quote Originally Posted by robert6000 View Post
    I thought that authoHeight and maxHeight config options are the best solution, but it doesn't work or I don't know how to use it.

    So my question is when can I use maxHeight config option and what is it's destination?


    Robert.
    If you look at the 2.02 - 2.2 source code (I do not have subversion access), you will see that GridPanel/GridView use autoHeight, but not maxHeight. Perhaps this is a documentation bug?

    So, it looks like you cannot use maxHeight to get the result you want.
    Last edited by carol.ext; 8 Sep 2008 at 5:53 AM. Reason: add more to be more clear

  10. #10

    Default

    carol.ext thanks for the info!

    I hope that maxHeight config option will be enable in the future because it would be very helpfull

    Robert

Page 1 of 2 12 LastLast

Posting Permissions

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