Strange problems with using MVVM bindings with templates

2 posts, 0 answers
  1. Keith
    Keith avatar
    33 posts
    Member since:
    Jan 2013

    Posted 19 May 2014 Link to this post

    I'm trying to bind a pretty simple model to a template and keep getting an error "Cannot read property 'replace' of undefined".   Please see the following fiddle:
    http://jsfiddle.net/keithnolan/2EN3m/3/

    I've tried to create an even simpler example in the below fiddle 
    http://jsfiddle.net/keithnolan/2EN3m/1/

    This also doesn't work but doesn't give any error.  If I remove everything except one single input then it works.  I'm guessing I'm missing something pretty obvious in the above examples.

  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 20 May 2014 Link to this post

    Hello Keith,

    I noticed that the template ID does not match the one provided as a value of the data-template attribute.

      <script id="div-template" type="x-kendo-template">
            <div style="height:500px" >
                <div class="k-edit-label">
                    <label for="ViewName">Name</label>
                </div>   
                <div data-container-for="ViewName" class="k-edit-field">
                    <input type="text" class="k-input k-textbox" name="ViewName" data-bind="value: ViewName">
                </div>                
            </div>
             
        </script>
    </head>
    <body>
      <div id="bodyDiv" >               
          <div id="visDiv" data-template="popupSummaryEditor" data-bind="source: summaryDef" >                       
          </div>      
        </div>
    </body>

    Please fix that and the error should not appear any more.

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top