Results 1 to 7 of 7

Thread: tabpanel not showing the items unless a height is specified

  1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    57
    Answers
    5
    Vote Rating
    0
      0  

    Default Answered: tabpanel not showing the items unless a height is specified

    I have a tabpanel inside a container which is showing the tabpanels toolbar on the bottom of the screen just fine. The problem I have is the panels/items for the tabpanels are not showing on the screen. I was hoping to have these panels/items fill the screen however the only way I can get them to appear is if I specify a height for the tabpanel. Then the items/panels apear and switch in and out like normal when clicking on the buttons in the tabpanels toolbar. Could someone please let me know what I have wrong in my code that is not enabling the items contents to appear on the screen.

    Code:
     Ext.define("GS.view.DetailContainer", {
    extend: 'Ext.Container', alias: 'widget.detail-container', requires: [
    'Ext.Toolbar', 'Ext.tab.Panel'
    ],
    config: {
    items: [{
    xtype: 'tabpanel', docked: 'bottom', tabBarPosition: 'bottom', defaults: {
    styleHtmlContent: true
    }, items: [
    {
    title: 'Home', iconCls: 'home', html: 'Home Screen'
    }, {
    title: 'Contact', iconCls: 'user', html: 'Contact Screen'
    }
    ]
    }]
    }
    });

  2. Give your Container a layout: 'fit'

  3. #2
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Give your Container a layout: 'fit'

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    57
    Answers
    5
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by jerome76 View Post
    Give your Container a layout: 'fit'
    No good Jerome. They still dont appear.

  5. #4
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Oh. It is because you are docking your tabPanel to the bottom of the container. Remove that line and it will show.

  6. #5
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    57
    Answers
    5
    Vote Rating
    0
      0  

    Default

    I solved the issue. The layout: 'fit' was needed but I also needed to drop the docked: 'bottom' on the tabPanel.

    My new code looks like this

    Code:
    Ext.define("GS.view.DetailContainer", {
    extend: 'Ext.Container', alias: 'widget.detail-container', requires: [
    'Ext.Toolbar', 'Ext.tab.Panel'
    ],
    layout: 'fit',
    config: {
    items: [{
    xtype: 'tabpanel', tabBarPosition: 'bottom', defaults: {
    styleHtmlContent: true
    },
    items: [
    {
    title: 'Home', iconCls: 'home', html: 'Home Screen'
    }, {
    title: 'Contact', iconCls: 'user', html: 'Contact Screen'
    }
    ]
    }]
    }
    });

  7. #6
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    57
    Answers
    5
    Vote Rating
    0
      0  

    Default

    Quote Originally Posted by jerome76 View Post
    Oh. It is because you are docking your tabPanel to the bottom of the container. Remove that line and it will show.
    Yes it is (sorry didn't see your post when I posted my code)

  8. #7
    Sencha User jerome76's Avatar
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132
    Vote Rating
    101
      0  

    Default

    Sorry I would have posted sooner but I was leaving 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
  •