我试图使用Sencha触摸脚本标记代理,以便我可以使用远程网站上的JSON文件,但是我看到在Safari控制台中解析错误,即使我有验证JSON文件是否正确。Sencha触摸脚本标记代理JSON读取器解析错误
我的模型是这样的:
Ext.regModel('NoteNewsModel', {
idProperty: 'id',
fields: [
{ name: 'id', type: 'int' },
{ name: 'title', type: 'string' },
{ name: 'description', type: 'string' }
// { name: 'icon', type: 'string' }
]
});
我的商店代码是这样的:
Ext.regStore('NotesNewsStore', {
model: 'NoteNewsModel',
proxy: {
type: 'scripttag',
url: 'myjsonurl',
reader: new Ext.data.JsonReader ({
type: 'json',
root: 'entries'
})
},
autoLoad: true
});
这里是远程服务器上的JSON文件的一部分:
{
"title":"json news",
"link":"https://myurl.com/json-news.html",
"description":"",
"language":"en",
"copyright":"my domain",
"ttl":"120",
"entries":[
{
"title":"SmarterMail Upgrade",
"link":"https://mydomain.com/122.html",
"date":"1316414335",
"guid":"https://mydomain.com/122.html",
"author":"flank plank",
"description":"test entry",
"introtext":"testing the intro text."
}
]
}
最后错误我看到在Safari控制台显示下面的第一行
“称号”:JSON新闻”, data.json:2SyntaxError:解析错误
任何帮助,在此,将不胜感激我一直在抓我的头几个小时就这一个了。
感谢阿龙
感谢您的答复我改变了这一部分,现在收到此错误信息:数据视图需要第三方物流,存储和itemSelector配置进行定义 – MonkeyBlue
@ llya139嗨感谢您的评论我有固定的错误我错过了{读者之后:但是我仍然得到解析错误?谢谢Aaron – MonkeyBlue