我試圖使用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