简体   繁体   English

jstree 1.0不能很好地工作

[英]jstree 1.0 does not work well

I have a problem with the new version of jstree when using this part of code. 使用这部分代码时,新版本的jstree出现问题。 At the first execution, 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. 据我了解,jsTree仅呈现根节点,然后在打开根节点时,会发送对url的ajax GET请求,并将数据函数的返回值作为参数字符串。 For example: 例如:

http://example.com/my_url?id=42

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM