title: Uncaught TypeError: Cannot read property 'replace' of undefined with KendoTreeView`
body: <p>Below is my KendoUI tree view, I am using templates to show edit link on each node, but I am getting this error: "Uncaught TypeError: Cannot read property 'replace' of undefined "</p>
  
  <pre><code> @section scripts{
          &lt;script src="~/scripts/kendo.all.min.js"&gt;&lt;/script&gt;
  
          &lt;script type="text/javascript"&gt;
  
            var  territory = new kendo.data.HierarchicalDataSource({
                  transport: {
                      read: {
                          type:'POST',
                          url: rootURL + "Territory/AllTerritories",
                          dataType: "json"
                      }
                  },
                  schema: {
                      model: {
                          id: "ID",
                          hasChildren: "HasChildren",
                          children: territory
  
                      }
                  }
              });
  
              $("#treeview").kendoTreeView({
                  dataSource: territory,
                  dataTextField: "Name",
                  dataValueField: "ID",
                  template: kendo.template($("#treeview-template").html())
              });
  
          &lt;/script&gt;
  
  
  
      }
  
      &lt;script id="treeview-template" type="text/kendo-ui-template"&gt;
          #
          &lt;a class='show-link' href='\#'&gt;&lt;image src="/Content/images/select2.png"&gt;&lt;/a&gt; #
      &lt;/script&gt;
      &lt;style scoped&gt;
          #territoryTree {
              text-align: center;
          }
          #treeview .k-sprite {
              background-image: url("../content/default/coloricons-sprite.png");
  
          }
          .rootfolder {
              background-position: 0 0;
          }
          .demo-section {
              display: inline-block;
              vertical-align: text-bottom;
              min-width: 320px;
              min-height: 300px;
              text-align: left;
              margin: 0 2em;
          }
      &lt;/style&gt;
  </code></pre>
  
  <p>Any solutions?? Please help</p>