I have a kendo grid that I am pulling data from an API (same site)... I cannot grid to populate with the data.
Here is an example of the json string...
[{"clientID":8,"memoID":14,"memoTime":"2012-05-09T09:04:00","subject":"Letter","memo":"Sent Letter ","initials":"AA","code":1,"private":false,"sticky":false}, ... and so on ...]
The data has no 'structure name' returned so in the schema section below I am not sure what to put?
Here is the code calling the JSON: (This is from one of your online examples)
<div id="example" class="k-content">
<div id="grid"></div>
$(document).ready(function() {
var grid = $("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "/memo/a/8/b/1",
dataType: "json",
}
},
schema: {
data: function (response) {
return response.data;
}
},
pageSize: 20,
serverPaging: true,
serverSorting: true,
serverFiltering: true
},
toolbar: kendo.template($("#template").html()),
height: 430,
sortable: true,
pageable: true,
columns: [
{ field: "MemoID", title: "MemoID", width: 100 },
{ field: "Subject", title: "Subject" },
{ field: "Initials", title: "Initials", width: 100 },
{ field: "Memo", title: "Memo" }
]
});
Here is an example of the json string...
[{"clientID":8,"memoID":14,"memoTime":"2012-05-09T09:04:00","subject":"Letter","memo":"Sent Letter ","initials":"AA","code":1,"private":false,"sticky":false}, ... and so on ...]
The data has no 'structure name' returned so in the schema section below I am not sure what to put?
Here is the code calling the JSON: (This is from one of your online examples)
<div id="example" class="k-content">
<div id="grid"></div>
$(document).ready(function() {
var grid = $("#grid").kendoGrid({
dataSource: {
transport: {
read: {
url: "/memo/a/8/b/1",
dataType: "json",
}
},
schema: {
data: function (response) {
return response.data;
}
},
pageSize: 20,
serverPaging: true,
serverSorting: true,
serverFiltering: true
},
toolbar: kendo.template($("#template").html()),
height: 430,
sortable: true,
pageable: true,
columns: [
{ field: "MemoID", title: "MemoID", width: 100 },
{ field: "Subject", title: "Subject" },
{ field: "Initials", title: "Initials", width: 100 },
{ field: "Memo", title: "Memo" }
]
});