Hi,
Am new to Kendo UI Grid, am trying to integrate Kendo with Domino API. Well for updating my backend doc i kind of need to use PATCH, but am trying to use this in Kendo the backend document are getting updated but not reflecting in frontend unless i do a refresh. Below is my sample code. Can someone please help me with this.
function loadKendoGrid(){
$(document).ready(function () {
var dataSource = new kendo.data.DataSource({
transport: {
read: {
url: "/testDB/sample.nsf/api/data/collections/name/locWiseAllNew",
dataType: "json"
},
update: {
url: function(options) {
return "/testDB/sample.nsf/api/data/documents/unid/" + options["@unid"]
},
contentType: "application/json",
type: "PATCH",
dataType: "json"
},
destroy: {
url: function(options) {
return "/testDB/sample.nsf/api/data/documents/unid/" + options["@unid"]
},
type: "DELETE"
},
parameterMap: function(options, operation) {
if (operation == "update" && options) {
var sendData = {};
sendData["Charge"] = options["Charge"];
sendData["FMNO"] = options["FMNO"];
sendData["CSS"] = options["CSS"];
return kendo.stringify(sendData);
}
}
},
error: function(r){
console.log(r)
},
schema: {
model: {
id: "unid",
fields: {
unid : {type: "string", editable: false, nullable: true },
$39: { type: "string", editable: false },
$83: { type: "string", editable: false },
$91: { type: "string", editable: false },
Charge: { type: "string" },
$53: { type: "string", editable: false },
FMNO:{ type: "string" },
$94: { type: "number", editable: false },
$95:{ type: "number", editable: false },
CSS: { type: "string"}
}
}
},
pageSize: 20
});
$("#grid").kendoGrid({
dataSource: dataSource,
height: 300,
filterable: true,
sortable: true,
pageable: true,
editable: "inline",
columns: [ {
field: "$39",
title: "Day"
},
{
field: "$83",
title: ""
},
{
field: "$91",
title: "CSS"
},
{
field: "Charge",
title: "Charge"
},
{
field: "$53",
title: "VA"
},
{
field: "VAincharge_FMNO",
title: "FMNO"
},
{
field: "$94",
title: "RT"
},
{
field: "$95",
title: "OT"
},
{
field: "CSS",
title: "CSS"
},
{ command: ["edit", "destroy"], title: " ", width: "250px" }
]
});
});
}