jstree 1.0 does not work well
I have a problem with the new version of jstree when using this part of code. At the first e开发者_如何学Pythonxecution, the data function returns the root node. The problem is that this code never executes again. So whatever happens, I just have the root node. Does anybody know a solution?
$('#tree').jstree(
json_data: {
ajax: {
url: '<%=url %>',
dataType: "json",
data: function (n) {
return {
"id": n.attr ? n.attr("id") : 0
};
}
}
},
themes: { url: '/ThirdParty/jquery/jsTree/themes/', theme: "default", dots: true, icons: true },
plugins: ["json_data", "themes", "ui"]
})
{
As I understand it, jsTree renders the root node only, then when you open the root node, an ajax GET request to url is sent with the return value of the data function as a parameter string. For example:
http://example.com/my_url?id=42
精彩评论