2012-06-26 85 views
1

我正在關注Sencha網站上的視頻,以創建我的第一個應用程序。Sencha Touch 2商店類型錯誤

這是我下面的視頻:Video

這是我使用的博客標籤代碼:

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

在Safari瀏覽器控制檯,它給我下面的錯誤在StoreManager.js:97:

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

我在做什麼錯?

回答

2

在行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' 
       } 
      } 
     }) 
+0

制定出好了添加此代碼!但現在它給了我這個警告,即使我將它添加到'require:[]' - '同步加載'Ext.data.proxy.JsonP';考慮明確添加'Ext.data.proxy.JsonP'作爲相應類的要求 – silentw