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

Thread: Grid Height

  1. #1
    Sencha User
    Join Date
    Jul 2010
    Posts
    46
    Answers
    3

    Default Grid Height

    I have a Ext.grid.Panel that is inside a Ext.panel.Panel.
    there is empty space at the end of the grid rows.
    Panel grows
    how do i size the panel Height to the variable size of the the grid?

  2. #2
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Which specific version of Ext JS are you using? Perhaps you could remove the panel and just have a grid panel. Often the extra nesting is unnecessary.

  3. #3
    Sencha User
    Join Date
    Jul 2010
    Posts
    46
    Answers
    3

    Default

    we are using ext-5.1.0.
    There are a number of developers using this code i'm not sure if i can remove panel.

    do you have any other suggestions?

    Thank you!

    here is config part of the code:

    orderDetailsGrid = Ext.create('Ext.grid.Panel', {
    id: 'orderDetailsModel',
    width: gridMaxwidth,
    store: orderTestDetStore,
    disableSelection: false,
    frame: false,
    border: true,
    stripeRows: true,
    columnLines: true,
    //scrollable: true,
    columns: [{



    var orderDetailPanel = Ext.create('Ext.panel.Panel', {
    title: orderDetailTitle,
    id: 'orderDetailPanelId',
    width: gridMaxwidth,
    height: 415,
    collapsible: true,
    renderTo: 'orderDetailsDiv',
    items: [orderDetailsGrid]

  4. #4
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    The grid is already a panel. Can I ask the reason for enclosing it in another panel?

  5. #5
    Sencha User
    Join Date
    Jul 2010
    Posts
    46
    Answers
    3

    Default

    i'm new to extjs and inheritted the code. i will find out about panels. Do you have any other suggestions?i know when we collapse the panel and expand again we calculate the height based on number of rows. Calculation is not great when there are a lot of rows and i cannot get it to work when grid first comes up.

  6. #6
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    If there is extra space, it sounds like the calculation is a bit off. Would it not be easier to have scrolling to handle when there are more rows than vertical space?

  7. #7
    Sencha User
    Join Date
    Jul 2010
    Posts
    46
    Answers
    3

    Default

    we want the panel to grow with the grid/number of rows.

  8. #8
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    There's no config to make the grid grow to fit its rows. If you did have that, you would still need scrolling to see those which would not fit on screen. Why not let the grid panel handle the scrolling?

  9. #9
    Sencha User
    Join Date
    Jul 2010
    Posts
    46
    Answers
    3

    Default

    The space we have is in the Parent Panel not in grid. i wanted that to shrink to the size of the grid panel. i will try to eliminate the parent panel.is there any way for parent panel to shrink to match contents? does shrinkWrap do this?

  10. #10
    Sencha User
    Join Date
    Feb 2013
    Location
    California
    Posts
    11,985
    Answers
    506

    Default

    Unless the outer panel is doing something, I highly recommend pulling it out as this can cause other scrolling issues as well and makes your application larger. That said, the shrinkWrap config seems to work:
    https://fiddle.sencha.com/#fiddle/1bgp

Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 1
    Last Post: 12 Sep 2010, 8:33 AM
  2. Grid Panel auto height and max height
    By kellyt in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 6 Oct 2008, 11:04 PM
  3. Expanding Height of Grid to Match Height of Document
    By jrochman in forum Ext 2.x: Help & Discussion
    Replies: 7
    Last Post: 23 Dec 2007, 1:47 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
  •