I have a web service that returns some data in json. I have validated the json returned and it's well formed.
Here's a sample:
{ "identifier": "ID", "items": [ { "ID": 2, "Description": "test 1" }, { "ID": 3, "Description": "test 2" } ] }
rather trivial, nothing complex.
But when I create a datagrid and pass this as the store, the grid shows an error.
onErrorFetch it shows this error:
Error fetching grid data : TypeError: this._arrayOfTopLevelItems is undefined
"this._arrayOfTopLevelItems is undefined"
Now what could possibly cause that problem? The json is valid, the structure is valid, what's the problem with dojo grid?
Any help would be greatly appreciated.
Some more information I found out is that if I save the same json to file and use a url instead of "data" for ItemFileReadStore, then it works Ok, it's just when the store is created with the json string assigned to "data".