This question is locked. New answers and comments are not allowed.
I am trying to get a client template working.
I have the following client template which works:
During runtime it evals to:
I want to make it conditionally displayed based on the Status value, so I modified it to:
Which evals at runtime to:
However, I get the following javascript error when I run that.
http://localhost/Amsi-v7.5.0/Scripts/2012.1.214/telerik.grid.min.js
Line 1
I can add a semicolon to my expression... which prevents the error...however, it doesn't work.
I feel I'm so close. If I simplify it and just put in simple strings it displays the correct string. Any help would be appreciated.
thanks,
BOb
I have the following client template which works:
var printTemplate = "<a href=" + Url.Action("Print", new { id = "<#= Key #>" }) + "><img alt='Print' src='" + Url.Content("~/Content/images/print.gif" + "'/></a>");During runtime it evals to:
<a href=/Amsi-v7.5.0/eFinancials/checkruncontrol/Print/%3C%23%3d%20Key%20%23%3E><img alt='Print' src='/Amsi-v7.5.0/Content/images/print.gif'/></a>I want to make it conditionally displayed based on the Status value, so I modified it to:
var printTemplate = "<# Status == \"R\" || Status == \"D\" ? " + "\"<a href=" + Url.Action("Print", new { id = "<#= Key #>" }) + "><img alt='Print' src='" + Url.Content("~/Content/images/print.gif" + "'/></a>") + "\" : '' #>";Which evals at runtime to:
<# Status == "R" || Status == "D" ? "<a href=/Amsi-v7.5.0/eFinancials/checkruncontrol/Print/%3C%23%3d%20Key%20%23%3E><img alt='Print' src='/Amsi-v7.5.0/Content/images/print.gif'/></a>" : '' #>However, I get the following javascript error when I run that.
http://localhost/Amsi-v7.5.0/Scripts/2012.1.214/telerik.grid.min.js
Line 1
missing ; before statement
I can add a semicolon to my expression... which prevents the error...however, it doesn't work.
I feel I'm so close. If I simplify it and just put in simple strings it displays the correct string. Any help would be appreciated.
thanks,
BOb