【问题标题】:jsTree nodes don't expand/collapsejsTree 节点不展开/折叠
【发布时间】:2011-08-08 16:27:14
【问题描述】:

无法让 jsTree 节点展开折叠。我一定错过了一些非常简单的东西。

这是脚本

<script type="text/javascript" src="<%= Url.Content("~/Scripts/jquery.jstree.js") %>"></script>
<script type="text/javascript">
        $(document).ready(function () {
            Refresh();
        });

        function Refresh() {
            $('#technologyTree').jstree({
                "json_data": {
                    "ajax": {
                        "url": "/TechnologyVersions/TechnologiesTreeAjax",
                        "type": "GET",
                        "dataType": "json"
                    }
                },

                "plugins": ["themes", "json_data", "ui"],

                "themes": {
                    "theme": "default",
                    "dots": true,
                    "icons": true,
                    "url": " <%= Url.Content("~/Content/jsTree/themes/default/style.css") %> "
                }
            });
        }
</script>

我可以看到正确填充的树并且来自控制器的 json 结果似乎正确。但是,当我单击那些展开/折叠箭头时,什么也没有发生。

【问题讨论】:

  • 在树的javascript文件之前不需要加载jquery吗?
  • @cpoDesign 我跳过发布 10000 javascript 库包括以节省空间:P 但真正的 jquery 在这里是相关的。我在下面发布了问题所在。

标签: asp.net-mvc-2 jstree


【解决方案1】:

问题在于与 jQuery 验证插件的冲突。升级到最新版本的jQuery验证插件解决了这个问题。

JsTree conflicts with jquery.validate

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-07-01
    • 2011-05-29
    • 2018-05-15
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多