title: Load DynaTree Dynamically
body: <p>I have a dynatree which I want to load the tree data dynamically. I am using this in conjunction with the jquery accordion. I'm using a for each loop to populate div's but this will be better for illustartion. Here are my divs </p>
  
  <pre><code>&lt;div id="accordion"&gt;
  &lt;h3&gt;Project Type&lt;/h3&gt;
       &lt;div id="1" class="common" style="height:150px;"&gt; 
      &lt;/div&gt;
  
       &lt;h3&gt;Ammenities&lt;/h3&gt;
      &lt;div id="2" class="common" style="height:150px;"&gt;  
      &lt;/div&gt;
  &lt;/div 
  </code></pre>
  
  <p>I want to pass the id of div to the initajax function of the tree. I am getting the ID like this.</p>
  
  <pre><code>        $(".common").prev('h3').click(function () {
            currentID = $(this).next().attr("id");
  </code></pre>
  
  <p>I would like to pass currentID to this function </p>
  
  <pre><code> var URL = "/Home/GetProjectTypeData/?currentID"
  $(".common").dynatree({
      checkbox: true,
      icon: false,      
      initAjax: {
          type: "POST",
          url: URL + '=' + currentID,
          data: {},
      },
  </code></pre>
  
  <p>I've tried a couple different things, with no luck. Ideally I want each div to be populated with the tree view on click of the accordion header
  Thank you</p>