1. #1
    Sencha User
    Join Date
    Aug 2013
    Posts
    8
    Vote Rating
    0
    mtadros is on a distinguished road

      0  

    Default Answered: Determine the height of a grid

    Answered: Determine the height of a grid


    Hello all,

    I have a simple Grid based on http://www.sencha.com/examples/#ExamplePlace:basicgrid
    I would like the ContentPanel root (in the example) to fit the grid without the space between the grid and the ContentPanel. Is there a way to determine the height of the grid, so I can get set the height within the ContentPanel or should I use a different type of Panel?

    Best Regards

    grid.png

  2. The grid needs to be given its size explicitly by either setting it to the grid, or by a parent container that implements resizable.

    The layout containers guide covers the possible containers that can be a parent container that could give the grid its size. Depending on the layout, it could be VerticalLayoutContainer or maybe even better the CssFloatLayoutContainer.
    http://docs.sencha.com/gxt-guides/3/...ontainers.html

    This covers how layout data and how containers are sized and how those containers can size their children.
    http://docs.sencha.com/gxt-guides/3/...s/Layouts.html

    I suspect you wouldn't need to find the height of the grid at this point.
    grid.getOffsetHeight()

    Brandon

  3. #2
    Sencha - GXT Dev Team
    Join Date
    Jan 2012
    Location
    Arlington, WA
    Posts
    442
    Answers
    7
    Vote Rating
    15
    branflake2267 will become famous soon enough

      0  

    Default


    The grid needs to be given its size explicitly by either setting it to the grid, or by a parent container that implements resizable.

    The layout containers guide covers the possible containers that can be a parent container that could give the grid its size. Depending on the layout, it could be VerticalLayoutContainer or maybe even better the CssFloatLayoutContainer.
    http://docs.sencha.com/gxt-guides/3/...ontainers.html

    This covers how layout data and how containers are sized and how those containers can size their children.
    http://docs.sencha.com/gxt-guides/3/...s/Layouts.html

    I suspect you wouldn't need to find the height of the grid at this point.
    grid.getOffsetHeight()

    Brandon

  4. #3
    Sencha User
    Join Date
    Aug 2013
    Posts
    8
    Vote Rating
    0
    mtadros is on a distinguished road

      0  

    Default


    Thank you Brandon, ViewPort is what I used and it works well.

Thread Participants: 1

Tags for this Thread