1. #1
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    31
    Answers
    3
    Vote Rating
    0
    mattgolding is on a distinguished road

      0  

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

    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
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    Give your Container a layout: 'fit'

  4. #3
    Sencha Premium Member
    Join Date
    Mar 2012
    Posts
    31
    Answers
    3
    Vote Rating
    0
    mattgolding is on a distinguished road

      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
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      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
    31
    Answers
    3
    Vote Rating
    0
    mattgolding is on a distinguished road

      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
    31
    Answers
    3
    Vote Rating
    0
    mattgolding is on a distinguished road

      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
    99
    jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice jerome76 is just really nice

      0  

    Default


    Sorry I would have posted sooner but I was leaving work

Thread Participants: 1

Tags for this Thread