some MVVM click bindings don't work

2 posts, 0 answers
  1. fbaptiste
    fbaptiste avatar
    19 posts
    Member since:
    Apr 2007

    Posted 24 Jul 2014 Link to this post

    Using Kendo UI version 2014.1.528

    I have the following scenario (simplified):

    <script type="text/x-kendo-template" id="tmpl">
    <div class="list-group-item-heading" data-bind="click: OnClick1">

    <div class="list-group-item-heading" data-bind="click: OnClick2">

    <div class="list-group" data-bind="source: GetData" data-template="tmpl">

    in which case the first click works as expected and calls OnClick1. however, the second click and any following click-bindings do not work at all.

    any idea of what might be the issues
  2. Petyo
    Petyo avatar
    2444 posts

    Posted 25 Jul 2014 Link to this post

    Hello Fred,

    the problem is due to multiple root elements being present in the template. If you wrap them in a single element (another div), the binding should work fine. 

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