title: Kendo UI Treeview Add/Remove Nodes
body: <p>I have a Kendo UI Treeview with an external json file as a Hierarchical Data Source on an html page.</p>
  
  <p>I want to add and remove nodes from the treeview and I followed the demo on the Kendo page but I get a</p>
  
  <p><code>TypeError: c.replace is not a function</code> on <code>jquery.min.js:2</code> on Web Console for the remove </p>
  
  <p>and a</p>
  
  <p><code>HierarchyRequestError: Node cannot be inserted at the specified point in the hierarchy</code> on <code>jquery.min.js:2</code> on Web Console for the append..</p>
  
  <p>My code is:</p>
  
  <pre><code>$(document).ready(function() {
              $.getJSON("OnTheSpotDATA/" + parent.accountID + "/" + parent.username + "/" + "tree.json", function (data) {
                  var treeview = $("#treeview").kendoTreeView({
                      dragAndDrop: true,
                      dataSource: kendo.observableHierarchy(data)
                  });
                  $(".k-treeview").data("kendoTreeView").bind("dragstart", function(e) {
                      if (e.sourceNode.childNodes.length &gt; 1) {
                          e.preventDefault();
                      }
                  });
                  $("#removeNode").click(function() {
                      var selectedNode = treeview.select();
  
                      treeview.remove(selectedNode);
                  });
                  $("#appendNodeToSelected").click(function() {
                      var selectedNode = treeview.select();
  
                      if (selectedNode.length == 0) {
                          selectedNode = null;
                      }
  
                      var nodeText=prompt("Please enter desired Node name","Default");
  
                      if (nodeText == null) {
                          return;
                      }
  
                      treeview.append({
                          text: nodeText
                      }, selectedNode);
                  });
              })
  </code></pre>
  
  <p>What am I doing wrong? Any way to fix this?I suppose it should be working right..</p>