Hi,
I have a grid with nested property 'OrderName'. Not all rows have the OrderName but this is no problem. Everything works perfect till I want to delete row and this row does not have the OrderName (there is no reference to a Order table/object).
I get the error:
Cannot set property 'OrderId' of null
at Object.eval [as Order.OrderId] (eval at setter (kendo.all.js:2138), <anonymous>:3:16)
Schema definition:
<schema>
<model id="Id">
<fields>
<field name="CreateDate" type="date"></field>
<field name="UserName" from="CustomerUser.Name"></field>
<field name="AnswerDate" type="date"></field>
<field name="OrderName" from="Order.OrderId" default-value="String.Empty"></field>
<field name="Direction" type="number"></field>
<field name="CustomerName" from="Customer.Name" default-value="String.Empty"></field>
</fields>
</model>
</schema>
Column definition:
<column field="OrderName" width="150" title="@SharedLocalizer["grid_column_order"].Value" template="@($"# if(OrderId !== null) {{# <a class='underline' href='{Url.Action("Detail", "Orders")}/#= OrderId #'>#= OrderName #</a>#}}#")"></column>
Delete function:
grid.dataSource.remove(dataItem);
grid.dataSource.sync();