Results 1 to 4 of 4

Thread: 2 grids in card layout with dynamic sizes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    8
    Vote Rating
    0
      0  

    Default 2 grids in card layout with dynamic sizes

    Hi,

    I have a card layout and I am trying to get the auto height to work. I am using the Ext.grid.panel and including them as follows.
    When I search on one grid then switch to the other by using panel.getLayout().setActiveItem(1)/or 0 The panel doesn't re size to accommodate the size of the displayed grid. I have even tried to use setHeight in the refresh event but it has bad side effects.

    Any idea how to setup multiple grids that have dynamic sizes. Oh yeah one more thing. We don't use scroll bars The app displays the whole page with no scrollbar.

    I have seen at times that when i set the height on the panel based on the grid.getHeight() that the height is incorrect. The actually table behind the grid is much larger.



    Code:
                
    var inner = Ext.create('Ext.panel.Panel', {
                    title: 'multiple grids',
                    layout: 'card',
                    id:'cardPanel',
                    //autoHeight:true,
                    bodyStyle: 'padding:0px',
                    title:false,
                    defaults: {
                        border: true
                    },
                    items: [me.grid1, me.grid2],
                    renderTo:'results'
                });
    example of the setting used for the grids
    Code:
              
    
    var searchResultGrid = new Ext.grid.GridPanel({
                 id : 'bobResultGrid',   
                 cls:'advisorDashboardGrid',
                 bodyCls:'advisorDashboardGrid-body',
                 scroll:false,
                 store: pagingStore,
                 columns: [{
                     menuDisabled: true,
                  }],
    viewConfig: { forceFit:true, showPreview:false, emptyText: Config.grid_no_data
    },
    // paging bar on the bottom tbar: top_bar

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,553
    Vote Rating
    1272
      0  

    Default

    card layout will handle the sizing of it's direct children.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    8
    Vote Rating
    0
      0  

    Default

    That's what I thought also.. But if I dig into the grid div the underlying table has a different height and overflows the grid container. So the rows out side the grid container are being hidden

  4. #4
    Sencha Premium Member
    Join Date
    Oct 2011
    Posts
    8
    Vote Rating
    0
      0  

    Default

    Any thoughts on what config I need to make this work?

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
  •