Я следил за приведенным здесь примером. Загрузка данных в список с помощью магазина Sencha Touch 2 и, похоже, работает, но когда я пытаюсь сделать то же самое, показать мне что-нибудьЗагрузка данных в список с помощью магазина Sencha Touch 2 и не отображается
Я новичок в sencha touch, и я не очень много знаю об этом Может кто-нибудь сказать мне, что я делаю неправильно?
Это код:
Главная:
var blogsStore = Ext.create("GS.store.blogs"); //put this in the items list
Ext.define('GS.view.Main',{
extend:'Ext.navigation.View',
xtype:'blog',
requires:[
'Ext.dataview.List',
'Ext.data.proxy.JsonP',
'Ext.data.Store',
'GS.store.blogs',
'GS.model.BlogModel'
],
config: {
title:'Blog',
iconCls:'star',
items:[
{
xtype:'list',
itemTpl:'{title}',
title:'Recent Posts',
store: blogsStore //Store instance here. And items are in array, not Object
}
]
}
});
Модель:
Ext.define('GS.model.BlogModel', {
extend: 'Ext.data.Model',
config: {
fields: [
{ name: 'title', type: 'auto' },
{ name: 'author', type: 'auto' },
{ name: 'content', type: 'auto' }
]
}
});
Магазин:
Ext.define('GS.store.blogs',{
extend:'Ext.data.Store',
requires: [
'GS.model.BlogModel',
'Ext.data.proxy.JsonP',
],
config:{
model:'GS.model.BlogModel',
autoLoad :true,
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'
}
}
}
});
app.js:
Ext.application({
name: 'GS',
requires: [
'Ext.MessageBox'
],
views: [
'Main'
],
stores: [
'blogs'
],
models:[
'BlogModel'
],
icon: {
'57': 'resources/icons/Icon.png',
'72': 'resources/icons/Icon~ipad.png',
'114': 'resources/icons/[email protected]',
'144': 'resources/icons/[email protected]'
},
isIconPrecomposed: true,
startupImage: {
'320x460': 'resources/startup/320x460.jpg',
'640x920': 'resources/startup/640x920.png',
'768x1004': 'resources/startup/768x1004.png',
'748x1024': 'resources/startup/748x1024.png',
'1536x2008': 'resources/startup/1536x2008.png',
'1496x2048': 'resources/startup/1496x2048.png'
},
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('GS.view.Main'));
},
onUpdated: function() {
Ext.Msg.confirm(
"Application Update",
"This application has just successfully been updated to the latest version. Reload now?",
function(buttonId) {
if (buttonId === 'yes') {
window.location.reload();
}
}
);
}
});