【发布时间】: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