Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
2745
[Bug] igTemplating - Anchored Hyperlinks
posted

In an inGrid I need to use a template to represent some data.  If a hidden column value, whose data type is a bool in my grid, is true, I show one hyperlinked image, otherwise I show another.  The action on the hyperlink is invoked via an OnClick event.

Using the MVC wrapper, the template looks like this:

.Template("{{if ${IsActive} == true}} <a href='#' onclick='javascriptEventA();'><img href='ImageA.png' /></a> {{else}} <a href='#' onclick='javascriptEventB();'><img href='ImageB.png' /></a> {{/if}}

Because both of my conditions contain a hash (#), the templating engine is treating all of the text between the two as comments and is stripping that information out of my template.  If I remove one of the hashes, then it works fine.  If i remove both, it works fine.  But if I remove them, then the image won't appear to be clickable.  It seems like the templating engine should be flip the sequence of when it checks for conditions vs when it checks for comments.

Unfortunately your documentation lacks any details of escaping a hash from within a template.

Parents Reply Children
No Data