Conditional template

2 posts, 1 answers
  1. Ian
    Ian avatar
    73 posts
    Member since:
    Jun 2013

    Posted 25 Jul 2013 Link to this post

    In my Tool Tip Target I specify if the type is an image or not:

    <a  data-type="image" data-popup="AccountExample.jpg" href="#" data-role="tooltip">
    Blah Blah

    In my ToolTip template I need to show the image if data-type="image" otherwise just the text in data-popup.

    The problem is that the tool tip is always empty. If I just replace the entire template with'popup')# the text appears so I know the tool tip is working.
    <script id="pop-template" type="text/x-kendo-template">
           <img src='@Url.Content("~/Content/images/")'popup')#'>

  2. Answer
    Dimo avatar
    8485 posts

    Posted 29 Jul 2013 Link to this post

    Hello Ian,

    The provided code snippet works as expected on my side. Please check the generated markup and make sure the resulting image URL is correct. You can add a debugger; statement inside the template script and break to check all expressions inside the template.

    If you are using an XHTML DOCTYPE, the <img /> tag should be self-closed, although this is not likely to be the root cause of the problem.

    If the problem persists, please send a runnable example for further inspection.

    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top