views:

60

answers:

1

I gotta problem with the new version of jstree by using this part of code, at the first execution ,the data function returns the root node.the problem is that this code never executes again. so what ever happens, I just have the root node. dose any body know any solutions??

$('#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"]

            })
            {
A: 

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
carpie