1
votes

Background: I am developing an application using the senchatouch 2 MVC framework. I am working on a screen which uses a tabpanel with two tabs.

Issue: In first tab, I want to display a titleBar and a List. I am able to display the titleBar but not the list inside the tab. When I inspected the element using Google Chrome, the list is shown as empty. I am using a sample List code from the sencha website. I am able to display list in another panel but it is not displayed when I am placing it as an item in tabPanel.

This is the code I am using:

Ext.define('POC.view.WUHomePage', {
    extend: 'Ext.TabPanel',
    requires: ['Ext.TitleBar', 'Ext.dataview.List', 'Ext.data.proxy.JsonP'],
    alias: 'widget.wuHomePageView',

    config: {
        fullscreen: true,
        tabBarPosition: 'bottom',
        cardSwitchAnimation: 'slide',
        defaults: {
            styleHtmlContent: true
        },

        items: [{
            // This is first tab
            title: 'Home',
            iconCls: 'home',
            items: [{
                xtype: 'titlebar',
                title: 'Hello',
                docked: 'top',
                items: [{
                    xtype: 'button',
                    text: 'LogOut',
                    ui: 'action',
                    itemId: 'newButton',
                    align: 'right'
                }]
            }, {
                xtype: 'list',
                title: 'Sample',
                fullscreen: true,
                itemTpl: '{title}',
                data: [{
                    title: 'Item 1'
                }, {
                    title: 'Item 2'
                }, {
                    title: 'Item 3'
                }, {
                    title: 'Item 4'
                }]
            }]
        },
        // This is second tab
        {
            title: 'Contact',
            iconCls: 'user',
            html: 'Contact Screen'
        }]
    },

});    
1

1 Answers

5
votes

Do not set the list to fullscreen. Only one component should be set to fullscreen, in your case it is the TabPanel. Instead set the list to height 100% and the parent component with a fit layout.