title: How to populate data in jstree in Grails?
body: <p>I'm still struggling to populate a jstree inside a Grails gsp. What I have so far is this (re-typed so forgive syntax errors):</p>
  
  <pre><code>&lt;script&gt;
      $("#treeView").jsTree();
  &lt;/script&gt;
  
  &lt;div id="treeView"&gt;
      &lt;g:each in="${atomMap}"&gt;
          &lt;li id="root"&gt;&lt;a href="#"&gt;${it.key}&lt;li&gt;
              &lt;ul&gt;
                  &lt;g:each in="${it.value}"&gt;
                      &lt;li&gt;&lt;a href="#"&gt;${it.value}&lt;/a&gt;&lt;/li&gt;
                  &lt;/g:each&gt;
              &lt;/ul&gt;
          &lt;/li&gt;
      &lt;/g:each&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My data displays on the page as a list of bullets, then the jstree overwrites it with empty data. How do I associate the data in "atomMap" to the tree itself? All of the examples I see use static data for "html_data" in the tree.</p>