When a new row is added without a defined schema model for the data source, there is no "address" field in the object being created. The column attempting to access "address.street" is looking for the "street" field within the undefined "address" field, resulting in an error.
The downside is that the schema model definition doesn't easily support nested types. However, you can resolve this by defining an "address" field with a defaultValue of {}. This adjustment should satisfy the Grid editor.
$("#myGrid").kendoGridEx({
...
columns: [
{ field: "address.street" },
{ field: "address.city" },
{ field: "address.state" },
...
],
dataSource: new kendo.data.DataSourceEx({
...
schema: {
model: {
id: "Id",
fields:{
address: { defaultValue: {} },
},
},
},
...
}),
});
Now, when adding a new row, the "address" field of the bound object will be {}. While "street", "city", and "state" are still undefined, their parent object "address" is defined, preventing any errors when accessing its fields.