title: valid json to create a jstree nodes dynamically
body: <p>I have a method that returns a list of roles, I want to put those roles in the jstree but I don't know how.</p>
  
  <p>I tried to do the following but I just don't know how to make a valid json for jstree  </p>
  
  <pre><code>function createNodeList() {
          $('#processRoleTree').jstree({
              "json_data": {
  
                  "ajax": {
                      "type": "POST",
                      "url": "/TreeLoader.aspx?Action=GetProcessRoles",
                      "dataType": "json",
                      "data": function (n) { return { id: n.attr ? n.attr("id") : 0} }
  
                  }
  
              },
              "plugins": ["json_data", "themes", "ui"]
  
  
          }).bind("select_node.jstree", function (e, data) {
              var selectedObj = data.rslt.obj;
              alert(selectedObj.attr("id"));
          });
      }
  </code></pre>
  
  <p>on the TreeLoader.aspx page load i have:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
      {
          if (Request.QueryString["Action"].Equals("GetProcessRoles"))
  
          {
              GetProcessRoles();
          }
  
      }
  </code></pre>
  
  <p>GetProcessRoles is my method that returns a list of ProcessRole object.</p>