clu3Less
clu3Less

Reputation: 1882

Sencha List Not displaying

Ext.define('myapp.view.alerts.Alerts', {
    extend : 'Ext.List',
    fullscreen: true,
    itemTpl: '{title}',
    data: [
        { title: 'Item 1' },
        { title: 'Item 2' },
        { title: 'Item 3' },
        { title: 'Item 4' }
    ]
});

The list gets displayed, but not text inside them. Why is this happening? This is the exaple from Sencha Docs. http://docs.sencha.com/touch/2.3.1/#!/api/Ext.dataview.List Please help.

Upvotes: 0

Views: 56

Answers (1)

rixo
rixo

Reputation: 25001

In the example, they are using Ext.create, meaning they can pass the config options directly. You, on the other hand, extend the class, so you must put overridden config options in the config, not the root:

Ext.define('myapp.view.alerts.Alerts', {
    extend : 'Ext.List',
    config: {
        fullscreen: true,
        itemTpl: '{title}',
        data: [
            { title: 'Item 1' },
            { title: 'Item 2' },
            { title: 'Item 3' },
            { title: 'Item 4' }
        ]
    }
});

Upvotes: 2

Related Questions