Results 1 to 7 of 7

Thread: Grid in TabPanel: how to set height?

  1. #1
    Sencha User
    Join Date
    Mar 2010
    Posts
    249

    Default Grid in TabPanel: how to set height?

    Code:
        var 
            grid = new Ext.grid.EditorGridPanel({
                store: store1,
                clicksToEdit: 1,
                colModel: colModel,
                autoExpandColumn: "ColField1"
            }),
            tp = new Ext.TabPanel({
                region: "center",
                activeTab: 0,
                items: [{
                    title: "Grid# 1",
                    items: [grid]
                }, {
                    title: "Grid# 2",
                    html: "html"
                }]
            }),
            viewport = new Ext.Viewport({
                layout: "border",
                renderTo: Ext.getBody(),
                items: [tp]
            });
    But grid doesn't fill all space of Tab.

  2. #2
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    I can't face it again. Sorry.

    Why? Why do you do it?

  3. #3
    Sencha User
    Join Date
    Mar 2010
    Posts
    249

    Default

    Code:
        var 
            grid = new Ext.grid.EditorGridPanel({
    ==>            region: "center",
                store: store1,
                clicksToEdit: 1,
                colModel: colModel,
                autoExpandColumn: "ColField1"
            }),
            tp = new Ext.TabPanel({
                region: "center",
                activeTab: 0,
                items: [{
    ==>                layout: "border",
                    title: "Grid# 1",
                    items: [grid]
                }, {
                    title: "Grid# 2",
                    html: "html"
                }]
            }),
            viewport = new Ext.Viewport({
                layout: "border",
                renderTo: Ext.getBody(),
                items: [tp]
            });

  4. #4
    Sencha User
    Join Date
    Mar 2010
    Posts
    249

    Default

    Quote Originally Posted by Animal View Post
    Why? Why do you do it?
    Where am I wrong?

  5. #5
    Sencha User Animal's Avatar
    Join Date
    Mar 2007
    Location
    Bédoin/Nottingham
    Posts
    30,890

    Default

    http://dev.sencha.com/deploy/dev/doc...=Ext.Container

    And from just a few lines into that EXTREMELY important class which you have to know because you use it all the time....



    Note it says grid as tab.

  6. #6
    Sencha User Condor's Avatar
    Join Date
    Mar 2007
    Location
    The Netherlands
    Posts
    24,245

    Default

    To be completely clear:
    Do not overnest! There is no reason to use a panel to contain a gridpanel.
    Code:
    var grid = new Ext.grid.EditorGridPanel({
      title: "Grid# 1",
      store: store1,
      clicksToEdit: 1,
      colModel: colModel,
      autoExpandColumn: "ColField1"
    }),
    tp = new Ext.TabPanel({
      //region: "center",
      activeTab: 0,
      items: [//{
        //items: [grid]
      //},
      grid,
      {
        title: "Grid# 2",
        html: "html"
      }]
    }),
    viewport = new Ext.Viewport({
      layout: "fit", //"border",
      //renderTo: Ext.getBody(),
      items: [tp]
    });

  7. #7
    Sencha User
    Join Date
    Mar 2010
    Posts
    249

    Default

    Quote Originally Posted by Condor View Post
    There is no reason to use a panel to contain a gridpanel.
    Code:
    Many thanks

Similar Threads

  1. TabPanel: Set inner panel height on viewport resize
    By randomuser01 in forum Ext 2.x: Help & Discussion
    Replies: 11
    Last Post: 13 Jan 2009, 10:59 AM
  2. set tabPanel width and height to be 100%
    By ruralclimber in forum Ext 2.x: Help & Discussion
    Replies: 1
    Last Post: 20 Nov 2008, 1:08 PM
  3. Set the dynamic Height for TabPanel
    By Rajarajeswari MS in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 23 Oct 2008, 1:38 AM
  4. Ext.TabPanel().addTab & clean way to set height?
    By Saeven in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 19 Mar 2007, 8:15 PM

Posting Permissions

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