0
sencha touch 2を使用して、jsonプロキシでネストされたリストをレンダリングしようとしています。 JSON私はdisplayField 私の店は私が得るすべてのエラー キャッチされない例外TypeErrorで今Sencha Touch JSONPReader
Ext.define('foo.store.FolderListing', {
extend: 'Ext.data.TreeStore',
require: ['foo.model.FolderListing'],
config: {
model: 'foo.model.FolderListing',
recursive: true,
proxy: {
type: 'jsonp',
url: 'http://localhost/?xx=yy&format=json',
callbackKey: "jsoncallback",
reader: {
type: 'json',
rootProperty: 'GetFolderListing',
record: 'folder'
}
}
}
});
のように見えるようGetFolderListing.folder.nameを使用したい
[
{
"start": "0"
},
{
"format": "json"
},
.......
{
"GetFolderListing": [
{
"folder": {
"total": 0,
"id": "Calendar",
"name": "Calendar",
"unread": 0,
}
},
{
"folder": {
"total": 0,
"id": "Contacts",
"name": "Contacts",
"unread": 0,
}
},
.......
次のようになります読み取ることができません。プロパティ 'id' of undefined
これを解決する方法やデバッグを改善する方法や、カスタム解析とアイテムを店舗に戻す方法については、誰でも洞察を提供できますか?
========更新
おかげ - rootPropertyリーダで動作するために、JSONは例えばjsonobjectなく、JSON配列でなければなりませんでした
{
"GetFolderListing": [
{
"folder": {
"total": 0,
"id": "Contacts",
"name": "Contacts",
"unread": 0,
"leaf": "true"
}
},
{
"folder": {
"total": 0,
"id": "Conversation Action Settings",
"name": "Conversation Action Settings",
"unread": 0,
"leaf": "true"
}
},
.......
はい、JSONはrootPropertyが機能するためには、兄弟の最初のセットに対してマップ可能なマップにする必要があります。ありがとうございました ! – pjaol