title: Dynamically creating nodes in a jstree tree structure
body: <p><br/>
  I have to retrieve a list of menu item from a database and display it in a tree structure<br/> I want to use the menu name as the node name and menu id as the id of the node.
  The method I used was to retrieve the data using an ajax call and put them into a list and then display it as a tree.But I think dynamically creating nodes depending on the data is more efficient.</p>
  
  <pre><code>   function createNodeList(){
          $('#menuCPanel #contentData #tree').jstree({            
              "json_data" : {
                  /*"data" : [{
                      "data" : {title : "menuName"},
                      "attr" : {id : "menuId"},
                      "state" : "closed"
                      }
                     ],*/
                   "ajax" :{
                      "type" : "POST",
                      "url" : "?m=admin?action=getNodeList",
                      "dataType" : "json",
                      "data" : function(result){
                          return {                            
                              id : result.attr ? result.attr("id") : result['menuId'],
                              title : result.attr ? result.attr("title") : result['menuName']
                          };
                      },  
  
                  },
              },
              "callback" : {
  
              },
  
              "themes" : {
                  "theme" : "classic",
                  "dots" : true,
                  "icons" : true
              },
              "plugins" : ["json_data", "themes"]
  
          }).bind("select_node.jstree", function (e, data) { alert(jQuery.data(data.rslt.obj[0], "jstree").id) });
  
      }
  
  
      }
  </code></pre>
  
  <p>this is the stucture of my json data<br/></p>
  
  <pre><code>"data":[{"menuId":"1","menuName":"Top Menu"},{"menuId":"2","menuName":"Main Menu"},{"menuId":"3","menuName":"Bottom Menu"},{"menuId":"4","menuName":"Main Menu"}]}
  </code></pre>
  
  <p>I would like to know what is wrong with the above result and how to dynamically create a node within in the ajax.success();<br/>
  I went through some examples but all of them use the jstree.cretate() which i can't invoke inside jstree.json_data.ajax.success()<br/>
  thanks in advance :)</p>