Sencha Touch 2 Store TypeError

旧巷老猫 提交于 2019-12-24 17:08:24

问题


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?


回答1:


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'
                }
            }
        })


来源:https://stackoverflow.com/questions/11209398/sencha-touch-2-store-typeerror

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!