I rewrote my web service as odata version 4. I have checked fiddle, and my get request is returning a 200 code, with json being correctly returned. However, the grid remains blank. I have paging and the total number of records is being displayed correctly by the grid. Unfortunately, no records are displayed.
Here's my html:
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
<meta charset="utf-8" />
<script src="Scripts/jquery.min.js"></script>
<script src="Scripts/kendo.all.min.js"></script>
<link href="Styles/kendo.common.min.css" rel="stylesheet" />
<link href="Styles/kendo.default.min.css" rel="stylesheet" />
</head>
<body>
<div id="example">
<div id="grid"></div>
<script>
$(document).ready(function() {
var dataSource = new kendo.data.DataSource({
type: 'odata-v4', // <-- Include OData style params on query string.
transport: {
read: {
url: "http://localhost:51394/odata/Complaint",
dataType: "json",
//parameterMap: function(data) {
// return kendo.data.transports.odata.parameterMap(data).replace("$inlinecount=allpages","$inlinecount=none");
//}
// dataType: "json" // <-- The default was "jsonp".
},
},
schema: {
model: {
id: "RecordNumber",
fields: {
RecordNumber: { type: "number" },
Filter_part_number: { type: "string" },
PlantMfrgLoc: { type: "string" },
Person_talked_to: { type: "string" }
}
},
data: function (data) {
return data.d;
},
total: function (data) {
return 830;
}
},
pageSize: 10,
serverPaging: false,
serverFiltering: true,
});
$("#grid").kendoGrid({
dataSource: dataSource,
pageable: true,
height: 550,
selectable: true,
editable: true,
columns: ["RecordNumber", "Filter_part_number", "PlantMfrgLoc", "Person_talked_to"]
});
});
</script>
</div>
</body>
</html>
Any ideas what I'm doing wrong?
Thanks.