I am struggling with declarative setting grid column to a external template
Here's my template
<script type="text/x-kendo-template" id="someTemplate">
<div>
<label> ${firstName}</label>
<label>${lastName}</label>
</div>
</script>
and here's the grid declaration
<div data-role="grid" data-bind="source: people" data-columns='[
{"field": "firstName",
"title": "Full Name",
"template": "kendo.template($("#someTemplate"))"
}
]'></div>
And here's JS Fiddle reproducing my problem: JSFiddle repro
You have 2 mistakes in your code :
kendo.template(...)
as it is a function and not between quotes.This gives such code :
"template": kendo.template($("#someTemplate").html())
See this jsfiddle : http://jsfiddle.net/bSGdW/9/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With