When i click on save/cancel button after editing I am getting js error
Unhandled exception at line 11, column 31201 in http://localhost:60267/Scripts/kendo.web.min.js
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'editable': object is null or undefined
Who could help?
<script>
function siteDropDownEditor(container, options) {
$('<input required data-text-field="SiteName" data-value-field="SiteId" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
transport: {
read: {
url: "/Employee/PopulateSiteList",
dataType: "json"
}
}
}
});
}
$(document).ready(function() {
$("#gridEmployeeList").kendoGrid({
dataSource: {
serverPaging: false,
serverSorting: false,
pageSize: 300,
transport: {
read: {
url: "/Employee/PopulateEmployeeList",
dataType: "json"
},
update: {
url: "/Employee/EmployeeUpdate",
dataType: "json"
}
//destroy: {
// url: "/Destroy",
// dataType: "json"
//},
//create: {
// url: "/Create",
// dataType: "json"
//}
}
},
height: 648,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
selectable: "row",
toolbar: ["create"],
editable: "inline",
resizable: true,
schema: {
model: {
id: "id",
fields: {
id: { editable: false, nullable: false },
LohikaId: { editable: true, nullable: false, type: "string" },
LastName: { validation: { required: true }, editable: true, type: "string" },
FirstName: { validation: { required: true }, editable: true, type: "string" },
Site: { validation: { required: true }, editable: true, type: "string" },
Email: { validation: { required: true }, editable: true, type: "string" },
StartDate: { validation: { required: true }, editable: true, type: "date" },
EndDate: { validation: { required: false }, editable: false, type: "date" },
IsAdvocate: { validation: { required: true }, type: "number" },
NonActive: { validation: { required: true }, type: "number" },
DomainNameLastName: { validation: { required: true }, editable: true, type: "string" }
}
}
},
columns: [
{
field: "id",
attributes: {
style: "display: none"
},
headerAttributes:{
style: "display: none"
}
},
{ field: "LohikaId", title: "LohikaId"},
{ field: "LastName", title: "Last Name"},
{ field: "FirstName", title: "First Name"},
{ field: "Site",
title: "Site",
editor: siteDropDownEditor,
template: "#=Site.SiteName#"
},
{ field: "Email", title: "Email" },
{ field: "StartDate", title: "Start Date",
type: "date",
template: '#= kendo.toString(StartDate,"dd/MM/yyyy") #',
attributes: {
style: "text-align: right"
}
},
{
field: "EndDate", title: "End Date",
editable: true,
type: "date",
template: '#= kendo.toString(EndDate,"dd/MM/yyyy") #',
attributes: {
style: "text-align: right, display: none"
}
},
{ field: "IsAdvocate", title: "IsAdvocate", type:"boolean", template: "<input type=\"checkbox\" # if(IsAdvocate){ # checked #} # />" },
{ field: "NonActive", title: "Is Term", type: "boolean", template: "<input type=\"checkbox\" # if(NonActive){ # checked #} # />" },
{ field: "DomainName", title: "DomainName" },
{
command: ["edit", "destroy"],
attributes: {
style: "width: 190"
},
headerAttributes:{
style: "width: 190"
}
}
]
});
});
</script>
<div id="gridEmployeeList" ></div>
Unhandled exception at line 11, column 31201 in http://localhost:60267/Scripts/kendo.web.min.js
0x800a138f - Microsoft JScript runtime error: Unable to get value of the property 'editable': object is null or undefined
Who could help?
<script>
function siteDropDownEditor(container, options) {
$('<input required data-text-field="SiteName" data-value-field="SiteId" data-bind="value:' + options.field + '"/>')
.appendTo(container)
.kendoDropDownList({
autoBind: false,
dataSource: {
transport: {
read: {
url: "/Employee/PopulateSiteList",
dataType: "json"
}
}
}
});
}
$(document).ready(function() {
$("#gridEmployeeList").kendoGrid({
dataSource: {
serverPaging: false,
serverSorting: false,
pageSize: 300,
transport: {
read: {
url: "/Employee/PopulateEmployeeList",
dataType: "json"
},
update: {
url: "/Employee/EmployeeUpdate",
dataType: "json"
}
//destroy: {
// url: "/Destroy",
// dataType: "json"
//},
//create: {
// url: "/Create",
// dataType: "json"
//}
}
},
height: 648,
scrollable: true,
sortable: true,
filterable: true,
pageable: true,
selectable: "row",
toolbar: ["create"],
editable: "inline",
resizable: true,
schema: {
model: {
id: "id",
fields: {
id: { editable: false, nullable: false },
LohikaId: { editable: true, nullable: false, type: "string" },
LastName: { validation: { required: true }, editable: true, type: "string" },
FirstName: { validation: { required: true }, editable: true, type: "string" },
Site: { validation: { required: true }, editable: true, type: "string" },
Email: { validation: { required: true }, editable: true, type: "string" },
StartDate: { validation: { required: true }, editable: true, type: "date" },
EndDate: { validation: { required: false }, editable: false, type: "date" },
IsAdvocate: { validation: { required: true }, type: "number" },
NonActive: { validation: { required: true }, type: "number" },
DomainNameLastName: { validation: { required: true }, editable: true, type: "string" }
}
}
},
columns: [
{
field: "id",
attributes: {
style: "display: none"
},
headerAttributes:{
style: "display: none"
}
},
{ field: "LohikaId", title: "LohikaId"},
{ field: "LastName", title: "Last Name"},
{ field: "FirstName", title: "First Name"},
{ field: "Site",
title: "Site",
editor: siteDropDownEditor,
template: "#=Site.SiteName#"
},
{ field: "Email", title: "Email" },
{ field: "StartDate", title: "Start Date",
type: "date",
template: '#= kendo.toString(StartDate,"dd/MM/yyyy") #',
attributes: {
style: "text-align: right"
}
},
{
field: "EndDate", title: "End Date",
editable: true,
type: "date",
template: '#= kendo.toString(EndDate,"dd/MM/yyyy") #',
attributes: {
style: "text-align: right, display: none"
}
},
{ field: "IsAdvocate", title: "IsAdvocate", type:"boolean", template: "<input type=\"checkbox\" # if(IsAdvocate){ # checked #} # />" },
{ field: "NonActive", title: "Is Term", type: "boolean", template: "<input type=\"checkbox\" # if(NonActive){ # checked #} # />" },
{ field: "DomainName", title: "DomainName" },
{
command: ["edit", "destroy"],
attributes: {
style: "width: 190"
},
headerAttributes:{
style: "width: 190"
}
}
]
});
});
</script>
<div id="gridEmployeeList" ></div>