I m working with kendo grid on mobile using java rest service. The response is in the form of an json array but still no data is shown in the kendo grid.
here is my code.
$(document).ready(function () {
//DataSource definition
// console.log(user);
var data = new kendo.data.DataSource({
dataType: "json",
transport: {
read: {
type: "POST",
url: "http://localhost:8079/Server/app/policy/getAll",
data: user
},
parameterMap: function (data, operation) {
return JSON.stringify(data);
}
},
batch: true,
//pageSize: 20,
schema: {
parse: function (d) {
// Get total_approved_products and display alert.
alert(d);
// Return data in order to be included in the `DataSource.data`
return d;
},
model: {
fields: {
idd: { type: "number" },
relation: { type: "string" },
dependent: { type: "string" }
}
},
}
});
console.log(data);
//Grid definition
var grid = $("#grid").kendoGrid({
dataSource: data,
selectable: true,
pageable: true,
//height: 430,
// toolbar: ["create"],
columns: [
{ field:"idd", title: "idd" },
{ field:"dependent", title: "dependent" },
{ field:"relation", title: " relation " },
{ command: { text: "View Details", click: showDetails } }
],
//bind click event to the checkbox
//editable: "inline"
});
//grid.data("kendoGrid");
});