Sometimes, when working with JSON data, you don't get the format you want. In particular, it's not uncommon to see nested JSON data expressed as an object, instead of arrays. For example:
Code:
[
{ "id": "foo_1", "baz": "baz_1", "bux": "bux_1", "bar": {
"bar_1": { "baz": "bar_baz_1", "bux": "bar_bux_1" },
"bar_2": { "baz": "bar_baz_2", "bux": "bar_bux_2" }
}
},
{ "id": "foo_2", "baz": "baz_2", "bux": "bux_2", "bar": {
"bar_1": { "baz": "bar_baz_3", "bux": "bar_bux_3" },
"bar_2": { "baz": "bar_baz_4", "bux": "bar_bux_4" }
}
}
]
ExtJS models can't read this out of the box. But it's possible to add a custom reader to your associations which can.
See this Gist: https://gist.github.com/twasink/5392441
or my blog post: http://twasink.net/2013/04/16/readin...-extjs-models/