Results 1 to 8 of 8

Thread: Grid height bigger than container

    Looks like we can't reproduce the issue or there's a problem in the test case provided.
  1. #1
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default Grid height bigger than container


  2. #2
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    I'm not clear on what the bug is here. The column layout never sets a height on the grid, so it grows to the height of the content.

    A simpler test case:

    Code:
    Ext.onReady(function() {
    
        Ext.widget({
            xtype: 'viewport',
            layout: 'fit',
            items: [{
                xtype: 'container',
                layout: 'anchor',
                anchor: '100% 50%',
                items: [{
                    layout: 'column',
                    items: [{
                        xtype: 'gridpanel',
                        store: {
                            fields: ['name'],
                            data: (function() {
                                var data = [];
                                for (i = 1; i <= 50; ++i) {
                                    data.push({
                                        name: 'Foo' + i
                                    });
                                }
                                return data;
                            })()
                        },
                        columns: [{
                            text: 'Name',
                            dataIndex: 'name',
                            flex: 1
                        }],
                        columnWidth: 1
                    }]
                }]
            }],
            renderTo: Ext.getBody()
        });
    
    });

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985

    Default

    Thanks for the report. I guess I'm not seeing the issue, sorry. Are you expecting scrollbars?

  4. #4
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    I want a quadrant, with 4 grids, and they resize equally both horizontally and vertically when the browser window resize. So if the grid has more data than they can fit it, each of the grid having too much data should have they own scrollbar to appear.

  5. #5
    Sencha Premium User
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,258

    Default

    Ok, in that case it's not a bug. For the grid to scroll you need to provide it with a height. Something that isn't heighted can't scroll.

  6. #6
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    If I put a grid in the center of a borderlayout it will scroll, I guess that layout is smart enough to set the size to what is inside, so I guess it set the height to the grid. I understand the grid needs a height, I'm looking for a layout, a container that size itself and then it provide the size to the grid so that we end-up with a 4 grid all sized pretty much the same when I resize the browser. I think I tried vbox with hbox and that was still a failure.

  7. #7
    Sencha Premium Member
    Join Date
    Sep 2014
    Location
    Germany Saxony
    Posts
    30

    Default

    Quote Originally Posted by SebTardif View Post
    If I put a grid in the center of a borderlayout it will scroll, I guess that layout is smart enough to set the size to what is inside, so I guess it set the height to the grid. I understand the grid needs a height, I'm looking for a layout, a container that size itself and then it provide the size to the grid so that we end-up with a 4 grid all sized pretty much the same when I resize the browser. I think I tried vbox with hbox and that was still a failure.
    Hi SebTardif,

    i think i have a solution for you.



    Container + layout hbox&vbox

    important: you must use flex and align: stretch

    i hope this will help you

  8. #8
    Sencha Premium User
    Join Date
    Feb 2011
    Location
    Cambridge, MA
    Posts
    1,295

    Default

    Quote Originally Posted by Mr-Money View Post
    important: you must use flex and align: stretch
    Thanks, it's working.

Similar Threads

  1. Replies: 3
    Last Post: 9 Mar 2015, 3:00 PM
  2. Grid 100% height not stretched to container's height
    By moshem in forum Sencha Ext JS Q&A
    Replies: 4
    Last Post: 21 Jul 2013, 8:13 AM
  3. Replies: 0
    Last Post: 5 Jul 2011, 4:26 PM
  4. BorderLayout east height is bigger that should be
    By Daniels in forum Ext 3.x: Bugs
    Replies: 2
    Last Post: 16 Aug 2010, 7:38 AM
  5. How to create bigger buttons (with bigger icons)?
    By dante in forum Ext 2.x: Help & Discussion
    Replies: 4
    Last Post: 2 Apr 2008, 5:15 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
  •