Add new record crashes when having a filter that filters all rows
See sample below.
Steps to reproduce;
1) In the grid, set filter to First Name = "xyz" , result: all records filtered.
2) Press Add new record button , result:
Microsoft JScript runtime error: Unable to get value of the property 'ID': object is null or undefined
<div id="grid">
</div>
<script type="text/javascript">
$(document).ready(function () {
var ds = new kendo.data.DataSource({
schema: {
model: {
id: "ID",
fields: {
ID: { type: "number", editable: false, nullable: true },
FirstName: { type: "string" },
LastName: { type: "string" }
}
}
},
data: [
{ ID: "1", FirstName: "Joe", LastName: "Smith" },
{ ID: "2", FirstName: "Jane", LastName: "Hilton" }
]
});
$("#grid").kendoGrid({
dataSource: ds,
columns: [
{ field: "ID", title: "ID" },
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" }
],
toolbar: ["create", "save", "cancel"],
editable: true,
navigatable: true, // tab thru the cells
autoBind: true,
sortable: true,
filterable: true,
scrollable: false
});
});
</script>
See sample below.
Steps to reproduce;
1) In the grid, set filter to First Name = "xyz" , result: all records filtered.
2) Press Add new record button , result:
Microsoft JScript runtime error: Unable to get value of the property 'ID': object is null or undefined
<div id="grid">
</div>
<script type="text/javascript">
$(document).ready(function () {
var ds = new kendo.data.DataSource({
schema: {
model: {
id: "ID",
fields: {
ID: { type: "number", editable: false, nullable: true },
FirstName: { type: "string" },
LastName: { type: "string" }
}
}
},
data: [
{ ID: "1", FirstName: "Joe", LastName: "Smith" },
{ ID: "2", FirstName: "Jane", LastName: "Hilton" }
]
});
$("#grid").kendoGrid({
dataSource: ds,
columns: [
{ field: "ID", title: "ID" },
{ field: "FirstName", title: "First Name" },
{ field: "LastName", title: "Last Name" }
],
toolbar: ["create", "save", "cancel"],
editable: true,
navigatable: true, // tab thru the cells
autoBind: true,
sortable: true,
filterable: true,
scrollable: false
});
});
</script>