transport: {
parameterMap: function (data, operation) {
if (operation !== "read") {
return JSON.stringify(data);
} else {
return (data);
}
},
read: {
url: function () {
return moduleServiceRoot;
},
type: "GET",
dataType: "json",
async: true
},
create: {
url: function (rec) {
return moduleServiceRoot;
},
type: "POST",
contentType: 'application/json; charset=utf-8',
dataType: "json",
async: true
},
complete: function (e) {
$("#grid").data("kendoGrid").dataSource.read();
async: true
},
},
requestStart: function (e) {
console.log('request started');
if (e.type == 'create' & validInput == false) {
console.log('request started');
e.preventDefault();
}
}
in the above code validInput is always false. if i comment out the if statement kendo grid read operation is prevented (grid does not show any data) but if i uncomment it, it won't work for kendo create, when i hit update in kendo popup editor.
read
type the return value but not for other events. But agree with @ThilakRao, under which circumstances do you want to cancel the update? Maybe it is easier somewhere else and with less side effects – OnaBai