This question is locked. New answers and comments are not allowed.
I don't know if it's a known bug or I'm the only one to realize it, but there is bug when we try to bind or use a DataSource object from a json with one field name called "data".
To demonstrate the problem, the codes below illustrates:
//Creating the DataSource
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "data/weather.json",
dataType: "json"
}
}
});
The JSON file:
[
{
"data": "Monday",
"highTemperature": 28,
"lowTemperature": 14,
"image": "shower"
}, {
"data": "Tuesday",
"highTemperature": 35,
"lowTemperature": 18,
"image": "sunny"
}, {
"data": "Wednesday",
"highTemperature": 30,
"lowTemperature": 16,
"image": "partly-sunny"
}
]
I intentionally changed the name of the field "day" from the Mobile example to "data".
The DataSource retrieved there is no data (length = 0). But when the json file is requested by AJAX (GET), the data retrieved is the correct json.
I used this name "data" because it's a fake cognate in Portuguese. It means "date" in portuguese. Now I changed this name and it's working. I took a lot of time to realize this, so I decided to write this report.
To demonstrate the problem, the codes below illustrates:
//Creating the DataSource
dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "data/weather.json",
dataType: "json"
}
}
});
The JSON file:
[
{
"data": "Monday",
"highTemperature": 28,
"lowTemperature": 14,
"image": "shower"
}, {
"data": "Tuesday",
"highTemperature": 35,
"lowTemperature": 18,
"image": "sunny"
}, {
"data": "Wednesday",
"highTemperature": 30,
"lowTemperature": 16,
"image": "partly-sunny"
}
]
I intentionally changed the name of the field "day" from the Mobile example to "data".
The DataSource retrieved there is no data (length = 0). But when the json file is requested by AJAX (GET), the data retrieved is the correct json.
I used this name "data" because it's a fake cognate in Portuguese. It means "date" in portuguese. Now I changed this name and it's working. I took a lot of time to realize this, so I decided to write this report.