Hi team,
As the question says, Im trying to define my template content as part of an html data attribute, see dojo: https://dojo.telerik.com/UxAPOXeV
But i get a syntax error when the widget is initialized.
Please advise.
Thanks,
Grant
I have the following template defined
<
script
type
=
"text/x-kendo-tmpl"
id
=
"tmplterminalSummary"
>
<
div
class
=
"row grandTotalRow"
><
br
>
<
span
class
=
"col-md-1 col-xs-3 resultLabel text-left"
>Gift Cards Terminal</
span
>
<
br
>
<
span
class
=
"col-md-2 col-xs-2 resultValue"
>#:kendo.toString(gcardGross,"c")#</
span
><
br
>
<
span
class
=
"col-md-3 col-xs-2 resultValue"
>#:kendo.toString(gcardRefund,"c")#</
span
><
br
>
<
span
class
=
"col-md-3 col-xs-2 resultValue"
>N/A</
span
><
br
>
<
span
class
=
"col-md-3 col-xs-2 resultValue"
>#:kendo.toString(netGCard,"c")#</
span
><
br
>
</
div
>
</
script
>
The issue I am having is that sometimes gcardGross is undefined. This results in a run time error like this https://screencast.com/t/6lHLtsliMx5F
I have tried replacing it with a line like this but unfortunately the error continues to occur.
<span class="col-md-2 col-xs-2 resultValue">#:gcardGross?kendo.toString(gcardGross,"c"):kendo.toString(0,"c")#</span><br>
So how can I define a default value so that 0 is shown if the property is undefined.
I read several post, but I can't find the way to correctly use french/english string in my template without crashing the templete with the # caracter.
see this part of a template:
<
div
class
=
"Stats"
>
<
span
class
=
"LikeCount"
>#=Html.Kendo().TemplateEncode(@Resources.PortailGES.Aime)#<
span
id
=
"LikeCount_#: Id #"
>#: LikeCount #</
span
></
span
>
<
span
class
=
"DislikeCount"
>@*@Resources.PortailGES.AimePas*@ <
span
id
=
"DislikeCount_#: Id #"
>#: DislikeCount #</
span
></
span
>
</
div
>
I try with #=Html.Kendo().TemplateEncode(@Resources.PortailGES.Aime)# but that not work
The string Ressource.PortailGES.Aime contain "J'aime" in french rendered in the template like: J'aime the crash the template.
Thanks for your help.
Hi,
in my case i have to implement cascading on 2 drop down boxes defined inside kendo ui Template . For example i have a category drop down box and on selection of category sub category drop down box gets sub categories of selected categories shown as options.
i couldn't find example in documentation for that. First , Is this possible?if so , could you please provide me syntax for that. Also i am using Kendo SPA example for 2 separate JS and Html files for code.
Thanks
Kendo gives me error and fails to load components during startup. I am using kendo version 2018.3.911.
This is the error I am getting.
kendo.all.js:232 Uncaught Error: Invalid template:'<
div
class
=
"k-group-indicator"
data-#=data.ns#
field
=
"${data.field}"
data-#=data.ns#
title
=
"${data.title || "
"}" data-#=data.ns#
dir
=
"${data.dir || "
asc"}"><
a
href
=
"\#"
class
=
"k-link"
><
span
class
=
"k-icon k-i-sort-${(data.dir || "
asc") == "asc" ? "asc-sm" : "desc-sm"}"
title
=
"(sorted ${(data.dir || "
asc") == "asc" ? "ascending": "descending"})"></
span
>${data.title ? data.title: data.field}</
a
><
a
class
=
"k-button k-button-icon k-bare"
><
span
class
=
"k-icon k-i-close"
></
span
></
a
></
div
>' Generated code:'var $kendoOutput, $kendoHtmlEncode = kendo.htmlEncode;$kendoOutput='<
div
class
=
"k-group-indicator"
data-'+(data.ns)+'
field
=
"'+($kendoHtmlEncode(data.field))+'"
data-'+(data.ns)+'
title
=
"'+($kendoHtmlEncode(data.title || "
"))+'" data-'+(data.ns)+'
dir
=
"'+($kendoHtmlEncode(data.dir || "
asc"))+'"><
a
href
=
"#"
class
=
"k-link"
><
span
class
=
"k-icon k-i-sort-'+($kendoHtmlEncode((data.dir || "
asc") == "asc" ? "asc-sm" : "desc-sm"))+'"
title
=
"(sorted '+($kendoHtmlEncode((data.dir || "
asc") == "asc" ? "ascending": "descending"))+')"></
span
>'+($kendoHtmlEncode(data.title ? data.title: data.field))+'</
a
><
a
class
=
"k-button k-button-icon k-bare"
><
span
class
=
"k-icon k-i-close"
></
span
></
a
></
div
>';return $kendoOutput;'
at Object.compile (kendo.all.js:232)
at Object.d [as template] (jquery-1.12.3.js:2)
at kendo.all.js:25533
at kendo.all.js:25912
at kendo.all.js:25919
at kendo.all.js:25525
at kendo.all.js:25528
compile @ kendo.all.js:232
d @ jquery-1.12.3.js:2
(anonymous) @ kendo.all.js:25533
(anonymous) @ kendo.all.js:25912
(anonymous) @ kendo.all.js:25919
(anonymous) @ kendo.all.js:25525
(anonymous) @ kendo.all.js:25528
Any ideas how to fix it? Or how to debug it?