Results 1 to 2 of 2

Thread: Auto height grids?

  1. #1
    Sencha User
    Join Date
    May 2015
    Posts
    6

    Default Auto height grids?

    Hello,

    After many many hours I have been unable to get consistent auto-height grids implemented using GXT 3.1.

    We are writing a data input system that uses several grids stacked on top of each other vertically inside a main window which is scrollable, thus the scrollbars in the grids are not required.

    The only way I have been able to reliably handle this is to manually calculate what we think the height of a grid might be based on the number of records we think it might have... I found another solution online for 'auto height' grids but these require forceLayout() to be called on parent layouts all over the place and it makes things appear clunky.

    Has anyone managed to implement a nice auto-height grid that just works? Having a large 'clunk' as the page invalidates itself isn't really the crisp user experience I'm trying to sell my boss with GXT

  2. #2
    Sencha User
    Join Date
    Nov 2011
    Posts
    4

    Default

    Your idea of an "auto height grid" may be different from mine, but here is what worked for me when my grids were misbehaving in GXT 2.2.5:

    Code:
    public class AutoHeightGrid<M> extends Grid<M> {
    
        public AutoHeightGrid(ListStore<M> store, ColumnModel cm) {
            super(store, cm);
        }
    
        @Override
        protected void onResize(int width, int height) {
            super.onResize(width, height);
            el().setStyleAttribute("height", "auto");
        }
    
    };
    It is literally an "auto height grid" in the sense that it applies CSS style "height: auto" to the grid after it resizes .

Similar Threads

  1. Replies: 2
    Last Post: 5 May 2014, 3:06 AM
  2. [CLOSED] [Ext 4.1] Store auto loads models, but grids don't auto load stores
    By Scott Murawski in forum Ext:Bugs
    Replies: 1
    Last Post: 23 May 2012, 2:37 PM
  3. Auto height for Grids on a Two-columns layout
    By csaffi in forum Ext GWT: Discussion
    Replies: 4
    Last Post: 31 Aug 2011, 5:53 AM
  4. Auto height panel based on templete height
    By Johnbran in forum Sencha Touch 1.x: Q&A
    Replies: 0
    Last Post: 28 Aug 2011, 7:39 PM
  5. Auto Height and auto width of ext panel not working
    By sachin sachdeva in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 13 Dec 2010, 7:49 AM

Posting Permissions

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