Question

I am very much beginner to Sencha Touch. I want to display a static list to the screen. The code I tried is from sencha docs guides 'using list'. However, blank screen appears when compiled and run. Do I have to add the list to the Viewport? What am I missing? Please help.

My code is:

Ext.application({
            launch: function () {
                Ext.create('Ext.List', {
                    store: {
                        fields: ['name'],
                        data: [
                            { name: 'A' },
                            { name: 'B' },
                            { name: 'C' },
                            { name: 'D' }
                        ]
                    },
                    itemTpl: '{name}'
                }); 
            }
        });
Was it helpful?

Solution

May be this one help you

Ext.create('Ext.List', {
        fullscreen: true,
        itemTpl: '{title}',
        data: [
            { title: 'Item 1' },
            { title: 'Item 2' },
            { title: 'Item 3' },
            { title: 'Item 4' }
        ]
    });

OTHER TIPS

Sorry! My bad. I made it with a little bit of work. I just did this:

launch: function() {
var list = Ext.Create('Ext.List',{..
                              .....
                              .....
           itemTpl = '{name}'
            });

      Ext.Viewport.add(list);
      }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top