or
<script type="text/x-kendo-tmpl" id="template">
<div>
<dl>
<dt>Street</dt> <dd>${Address.Street}</dd>
<dt>City</dt> <dd>${Address.City}</dd>
</dl>
</div>
</script>
But this leads to JavaScript exceptions, saying that the property is undefined. How can I handle this? Any idea is welcome, but this really a serious problem with complex data models. I cannot reduce my viewmodel to only have primitive properties, that woud cause too much effort...[DisplayName(
"Vendor"
)]
public
int
? VendorId {
get
;
set
; }
[DisplayName(
"Category"
)]
public
int
CategoryId {
get
;
set
; }
@(Html.Kendo().AutoComplete().Name("Expense.VendorId")
.DataTextField("VendorName")
.Filter(FilterType.StartsWith)
.Placeholder("Type in a Vendor...")
.DataSource(dataSource =>
{
dataSource.Read(read => read.Action("_GetVendors", "Expense"));
})
)
$(
'#grid'
).kendoValidator({
rules: {
specialDate:
function
(input) {
input.attr(
"data-specialDate-msg"
,
"The date should be 2013-01-02"
);
return
input.val() ==
'2013-01-02'
;
}
},
messages: {specialDate:
"The date should be 2013-01-02"
}
});