问题
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