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:

    I've tried to create an even simpler example in the below fiddle

    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
    Alexander Valchev avatar
    2895 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 data-container-for="ViewName" class="k-edit-field">
                    <input type="text" class="k-input k-textbox" name="ViewName" data-bind="value: ViewName">
      <div id="bodyDiv" >               
          <div id="visDiv" data-template="popupSummaryEditor" data-bind="source: summaryDef" >                       

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

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