This question is locked. New answers and comments are not allowed.
I am trying to use Kendo/Icenium to develop an app that talks to one or more existing Web backends, and am finding the Kendo DataSource to be brittle/buggy. I am using the Icenium Kendo Project boilerplate, making minor modifications to the weather.json file to reproduce more complex issues I have found.
1. kendo.data.DataSource can only be used for JSON results that are of type array. If the target service returns a single dictionary with embedded results, DataSource can't be made to deal with it. Perhaps there is a workaround? This can be reproduced by enclosing the array in weather.json in a dictionary that sets the array as its "results:" key, as in: { "results": [ ... ] }. How do you display this?
2. kendo/Icenium fails to log anything to the console if the returned JSON document is invalid. Simply insert an extra comma or remove an existing comma anywhere in the document. The spinner will spin forever and there is no feedback to the console.
3. The JSON parsing fails even on a perfectly legal JSON document if one of the array items contains a nested dictionary with a parent key. For example (again, slight mod to weather.json):
{
"day": "Monday",
"highTemperature": 28,
"lowTemperature": 14,
"image": "shower",
"nested" : { "parent" : 0 }
}
This results in an exception from kendo.mobile.min.js:
Uncaught TypeError: Property 'parent' of object [object Object] is not a function
These issues are unfortunately making it difficult to get off the ground. Any workarounds are appreciated.
1. kendo.data.DataSource can only be used for JSON results that are of type array. If the target service returns a single dictionary with embedded results, DataSource can't be made to deal with it. Perhaps there is a workaround? This can be reproduced by enclosing the array in weather.json in a dictionary that sets the array as its "results:" key, as in: { "results": [ ... ] }. How do you display this?
2. kendo/Icenium fails to log anything to the console if the returned JSON document is invalid. Simply insert an extra comma or remove an existing comma anywhere in the document. The spinner will spin forever and there is no feedback to the console.
3. The JSON parsing fails even on a perfectly legal JSON document if one of the array items contains a nested dictionary with a parent key. For example (again, slight mod to weather.json):
{
"day": "Monday",
"highTemperature": 28,
"lowTemperature": 14,
"image": "shower",
"nested" : { "parent" : 0 }
}
This results in an exception from kendo.mobile.min.js:
Uncaught TypeError: Property 'parent' of object [object Object] is not a function
These issues are unfortunately making it difficult to get off the ground. Any workarounds are appreciated.