Hi
Is it possible to write JavaScript code in a template - and instantiate the template implicitly by using kendo.Bind OR kendo.View?
Likewise, as part of a view template:
Because whenever I try and use #, #= or #:, it just renders as text :(
Leads me to believe it only works if you explicitly instantiate as a template:
I've only been able to use this notation to successfully render items:
Is it possible to write JavaScript code in a template - and instantiate the template implicitly by using kendo.Bind OR kendo.View?
<
script
type
=
"text/x-kendo-template"
id
=
"mytemplate"
>
# for (int i ... ) #
</
script
>
kendo.bind(jQuery('#mytemplate'), cardsViewModel);
var cards = new kendo.View('mytemplate', {
wrap: false,
model: cardsViewModel
});
jQuery('#targetelement').html(cards.render());
Leads me to believe it only works if you explicitly instantiate as a template:
var inlineTemplate = kendo.template($("#javascriptTemplate").html());
<
div
data-template
=
"my-template"
data-bind
=
"source: myItems"
>
</
div
>
<
script
type
=
"text/x-kendo-template"
id
=
"my-template"
>
<
span
data-bind
=
"text: this"
></
span
>
</
script
>