Can this template be improved? (Conditional)

2 posts, 0 answers
  1. Kjell
    Kjell avatar
    283 posts
    Member since:
    Jun 2010

    Posted 11 Jan 2017 Link to this post

    The template below works but it seems kind of goofy.  Is there a better way to set the "Checked" value conditionally?

    I can do it easily with a plain checkbox but I prefer to use the Kendo one for the styling.


    <script type="text/x-kendo-tmpl" id="connectorTemplate">
         <div class="tabOption">
             # if (Selected) { # 
             # } else { #
             # } #
             <span>#:Name# </span>
  2. Stamo Gochev
    Stamo Gochev avatar
    208 posts

    Posted 13 Jan 2017 Link to this post

    Hi Kjell,

    I think that you can place the Selected condition in the Checked property of the checkbox (similar to what you have done with the Id) and use the ternary operator. The following thread can be used as a reference:

    Stamo Gochev
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top