title: Dynatree does not reload with new nodes programatically
body: <p>I am loading the dynatree programitically when the page loads as follows</p>
  
  <pre><code>function loadTree(data)
  {
     var rootNode = $("#tree").dynatree("getRoot");
     $.each(data, function () {
        var childNode = rootNode.addChild({
                 title: this.agent_code + ' - ' + this.holder_name,
                 tooltip: this.holder_name,
                 isFolder: true,
                 key:this.agent_code,
         });
      });
   }
  </code></pre>
  
  <p>Now after i retrieve new data from the server and wants to load with new nodes it does not remove the old node.</p>
  
  <pre><code>function reload(data)
     {
          $("#tree").dynatree("getRoot").visit(function(node){
             node.remove();
          });
          loadTree(data)
     }
  </code></pre>
  
  <p>The above code removes only a single node. What am i missing here.
  Thanks in advance</p>
  
  <p><strong>UPDATE</strong>
   i tried with a workaround through the following code</p>
  
  <pre><code>function reload(data)
     {
          $("#tree").remove();
          $('#test').html('&lt;div id="tree"&gt;&lt;/div&gt;');
          $('#tree').dynatree(); //reinitialize the tree
          loadTree(data);
     }
  </code></pre>
  
  <p>It does reload but then cannot populate the child nodes through lazyloading</p>