I'm running Kendo UI v2015.3.1111 on IE 11.
I have an MVC6 controller action that looks like this:
public
IActionResult GetJsonData(Guid id)
{
var temp2 =
"[{\"id\": 1, \"Product\": \"Mower\", \"MSRP\": 189.99}, {\"id\": 2, \"Product\": \"Imagine Fountain\", \"MSRP\": 59.99}]"
;
return
Json(temp2);
}
On the client, my javascript function looks like this:
function
ApplyGrid(componentId) {
$(
'#grid01'
).kendoGrid({
dataSource: {
transport: {
read: {
url:
'/Data/GetJsonData/'
+ componentId,
dataType:
'json'
}
},
schema: {
data:
'data'
}
}
});
}
This generates the following exception:
Unhandled exception at line 11, column 28216
in
http:
//localhost:51518/kendo/kendo.all.min.js
0x800a138f - JavaScript runtime error: Unable to get property
'slice'
of undefined or
null
reference
How should my controller action return the json data? Or is there a different setting in the kendoGrid I should be using?