I'm experiencing some issues with the default "create" button to add a new empty row. Depending on what I enter for the grid column definition I get different htmlEncoding functions and they both fail.
In the first case I use the complete object with a template for the field value, and in that function it should be encoded with at least data.Product, otherwise it will never be reachable because all the data is in data.
In the second case I tried only the value and this time I get at least a conditional on if it is null but it doesn't catch the case that Product might be null already.
Nullable option doesn't do anything to those.
Is there any way to get around this, since I'm unable to add new entries without errors.
schema: {
model: {
id: "ProductId",
fields: {
Product : { type: "object" , nullable: true}
}
}
columns: [
{
field : "Product",
title : "Product",
width : 110,
template: #=Product['Name']#
}
}
(function(data
/**/) {
var o, e = kendo.htmlEncode;
with (data) {
o = '<tr class="k-alt" data-uid="' + (data.uid) + '" role=\'row\'><td role=\'gridcell\'>' + (Product['Name']) + '</td><td role=\'gridcell\'><a class="k-button k-button-icontext k-grid-edit" href="#"><span class="k-icon k-edit"></span>Bearbeiten</a><a class="k-button k-button-icontext k-grid-Loeschen" href="#"><span class=" "></span>Löschen</a></td></tr>';
}
return o;
})
columns: [
{
field : "Product['Name']",
title : "Product",
width : 110
}
}
(function(data
/**/) {
var o, e = kendo.htmlEncode;
with (data) {
o = '<tr class="k-alt" data-uid="' + (data.uid) + '" role=\'row\'><td role=\'gridcell\'>' + e(data.Product['Name'] == null ? '' : data.Product['Name']) + '</td><td role=\'gridcell\'><a class="k-button k-button-icontext k-grid-edit" href="#"><span class="k-icon k-edit"></span>Bearbeiten</a><a class="k-button k-button-icontext k-grid-Loeschen" href="#"><span class=" "></span>Löschen</a></td></tr>';
}
return o;
})