valid json to create a jstree nodes dynamically
问题 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. I tried to do the following but I just don't know how to make a valid json for jstree 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