silentw
silentw

Reputation: 4885

Sencha Touch 2 Store TypeError

I'm following the video on the Sencha website, for creating my first application.

This is the video I'm following: Video

This is the code I'm using for the Blog tab:

Ext.define('GS.view.Blog',{
    extend: 'Ext.navigation.View',
    xtype: 'blogpanel',

    requires: [
        'Ext.dataview.List',
        'Ext.data.proxy.JsonP'
    ],

    config: {
        title: 'Blog',
        iconCls: 'star',

        items: {
            xtype: 'list',
            itemTpl: '{title}',

            store: {
                autoLoad: true,
                fields: ['title', 'author', 'content'],

                root: {
                    leaf: false
                },

                proxy: {
                    type: 'jsonp',
                    url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',

                    reader: {
                        type: 'json',
                        rootProperty: 'responseData.feed.entries'
                    }
                }
            }
        }
    }
});

In the Safari Console, it is giving me the following error on StoreManager.js:97:

TypeError: 'undefined' is not a valid argument for 'instanceof' (evaluating 'store instanceof Ext.data.Store')

What am I doing wrong?

Upvotes: 1

Views: 1090

Answers (1)

Naresh Tank
Naresh Tank

Reputation: 1568

add this code at line store:

 store: new Ext.create('Ext.data.Store',{
            autoLoad: true,
            fields: ['title', 'author', 'content'],

            root: {
                leaf: false
            },

            proxy: {
                type: 'jsonp',
                url: 'https://ajax.googleapis.com/ajax/services/feed/load?v=1.0&q=http://feeds.feedburner.com/SenchaBlog',

                reader: {
                    type: 'json',
                    rootProperty: 'responseData.feed.entries'
                }
            }
        })

Upvotes: 2

Related Questions