On further analysis i found that it is looking for this file, which is not found 404(Also this error is not visible in console, the way i got to it is by putting a break point on mouse click event ).
GET http://localhost:1205/Scripts/kendo/src/js/kendo.grid.js 404 (Not Found)
I used Nuget to install kendo ui and it creates the following structure. so it is not going to find that file as that hierarchy does not exist.
Scripts
Kendo
2013.3.1119
cultures
all the javascript files
==================================================================================================================
I am using WebAPI and KendoUI Grid, the Mark is below.
When i click Edit button, it bring the row into EditMode, but when i press the done "Update" button nothing happens, seems like event is not firing.
No WebAPI are made, i tried debugging in Google chrome, but seems like Update event is not firing at all.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<!-- CDN-based stylesheet references for Kendo UI Web -->
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.common.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.rtl.min.css" rel="stylesheet" />
<link href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.silver.min.css" rel="stylesheet" />
<!-- CDN-based script reference for jQuery -->
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<!-- CDN-based script reference for Kendo UI -->
<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.all.min.js"></script>
<script>
$(document).ready(function () {
var orgModel = {
id: "OrgID_PK",
fields: {
OrgID_PK: {
editable: false,
type: "number"
},
OrgCode: {
type: "string",
nullable: false,
editable: true,
validation: {
required: {
message: "Org Code is required"
},
maxlength:10
}
},
OrgName: {
type: "string",
nullable: false,
editable: true,
validation: {
required: {
message:"Org Name is required"
},
maxlength:100
}
},
Description: {
type: "string",
validation: {
required: true,
minlength: 2,
maxlength: 160
}
},
EffectiveDate: {
type: "date",
validation: true
},
TerminationDate: {
type: "date",
validation: true
},
}
};
var ds = new kendo.data.DataSource({
serverFiltering: true, // <-- Do filtering server-side
serverPaging: true, // <-- Do paging server-side
serverSorting: true,
pageSize: 2,
batch :false,
type: 'odata', // <-- Include OData style params on query string.
transport: {
create: {
url: "http://localhost:3103/api/Org/putOrgs",
type: "PUT",
dataType: "json",
},
read: {
url: "http://localhost:3103/api/Org/GetOrgs", // <-- Get data from here
dataType: "json" // <-- The default was "jsonp"
},
update: {
//url: function (employee) {
// return "http://localhost:3103/api/Org/postOrg" + employee.Id
//},
url: "http://localhost:3103/api/Org/postOrg",
type: "POST",
dataType: "json",
},
destroy: {
url: function (employee) {
return "http://localhost:3103/api/Org/deleteOrg" + employee.Id
},
type: "DELETE",
dataType: "json",
},
parameterMap: function (options, type) {
//if (operation !== "read" && options.models) {
// return { models: kendo.stringify(options.models) };
//}
var paramMap = kendo.data.transports.odata.parameterMap(options);
//delete paramMap.$inlinecount; // <-- remove inlinecount parameter.
delete paramMap.$format; // <-- remove format parameter.
return paramMap;
}
}, //transport
schema: {
data: function (data) {
return data.Items; // <-- The result is just the data, it doesn't need to be unpacked.
},
total: function (data) {
return data.Count; // <-- The total items count is the data length, there is no .Count to unpack.
},
errors: "Errors",
error: function (e) {
alert(e.errors);
}
}, //schema
model: orgModel
});
$("#grid").kendoGrid({
dataSource: ds,
groupable: true,
sortable: true,
filterable:true,
editable: "inline",
toolbar: ["create"],
pageable: {
refresh: true,
pageSizes: true,
buttonCount: 5
},
columns: [{
field: "OrgID_PK",
title: "OrgID ",
width: 140
}, {
field: "OrgCode",
title: "Code",
width: 190
}, {
field: "OrgName",
title: "Name"
}, {
field: "Description",
width: 110
},
{
field: "EffectiveDate",
width: 110
},
{
field: "TerminationDate",
width: 110
},
{ command: ["edit", "destroy"], title: " ", width: "172px" }
], // columns
edit: function (e) {
//$('#grid').data('kendoGrid').dataSource.read();
console.log('edit started ');
console.log(e);
//e.preventDefault();
},
cancel: function (e) {
//$('#grid').data('kendoGrid').dataSource.read();
//$('#grid').data('kendoGrid').dataSource.sync();
console.log('cancel happened');
console.log(e);
//e.preventDefault();
// $('#grid').data('kendoGrid').dataSource.read();
},
update: function (e) {
console.log('edit completed');
console.log(e);
},
change: function (e) {
console.log('a change happened not datasource one');
console.log(e);
},
saveChanges: function (e) {
console.log('a save is about to occurr');
console.log(e);
},
}); //grid
}); // document
</script>
</head>
<body>
<div id="example" class="k-content">
<div id="clientsDb">
<div id="grid" style="height: 380px"></div>
</div>
</div>
</body>
</html>