bluedevil2k
bluedevil2k

Reputation: 9491

Sencha Touch - Why isn't this List Showing up?

Banging my head against the wall trying to figure out why this List won't show up in the Navigation View I've created in Sencha Touch. Only the title bar shows up, with a blank screen below it.

var topView = Ext.define("Parks.view.Main", {
    extend: "Ext.navigation.View",
    fullscreen: true,
    config: {
        items: [
            {
                title: "Parks & Rec",
                padding: 10,
                items: [
                {
                    xtype: "list", 
                    fullscreen: true, 
                    itemTpl: "{name}",
                    data: [{name: "Local Parks"}, {name: "Local Monuments"}],
                    listeners: {
                        select: function(view, record){

                        }
                    }
                }
                ]

            }
        ]
    }

});

Upvotes: 0

Views: 32

Answers (1)

Akatum
Akatum

Reputation: 4016

You should use fullscreen config only on your Parks.view.Main. To fit your list component inside parent container you can use fit layout:

Ext.define("Parks.view.Main", {
    extend: "Ext.navigation.View",
    fullscreen: true,
    config: {
        items: [
            {
                title: "Parks & Rec",
                padding: 10,
                layout: 'fit',
                items: [
                {
                    xtype: "list", 
                    itemTpl: "{name}",
                    data: [{name: "Local Parks"}, {name: "Local Monuments"}],
                    listeners: {
                        select: function(view, record){

                        }
                    }
                }
                ]

            }
        ]
    }
});

Ext.Viewport.add(Ext.create('Parks.view.Main'));

Upvotes: 1

Related Questions