我有一个 asp.net mvc4 应用程序,我想在其中添加一个 treeview 。所以我使用了这个 Jquery 库:graphdracula
<html>
<head>
<!-- jQuery -->
<script type="text/javascript" src="~/Content/Scripts/jquery-1.4.2.min.js"></script>
<!-- The Raphael JavaScript library for vector graphics display -->
<script type="text/javascript" src="~/Content/Scripts/raphael-min.js"></script>
<!-- Dracula -->
<!-- An extension of Raphael for connecting shapes -->
<script type="text/javascript" src="~/Content/Scripts/dracula_graffle.js"></script>
<!-- Graphs -->
<script type="text/javascript" src="~/Content/Scripts/dracula_graph.js"></script>
<script type="text/javascript" src="~/Content/Scripts/dracula_algorithms.js"></script>
<script type="text/javascript">
//Show UCLA CS class dependencies (not complete)
$(document).ready(function () {
var width = $(document).width() -500;
var height = $(document).height();
var g = new Graph();
g.edgeFactory.template.style.directed = true;
g.addEdge("Projet", "Fonction1");
g.addEdge("Fonction1", "Sous Fonction 1.1");
g.addEdge("Fonction1", "Sous Fonction 1.2");
g.addEdge("Projet", "Fonction2");
g.addEdge("Fonction2", "Sous Fonction 2.1");
g.addEdge("Fonction2", "Sous Fonction 2.2");
g.addEdge("Fonction2", "Sous Fonction 2.3");
g.addEdge("Fonction2", "Sous Fonction 2.4");
var layouter = new Graph.Layout.Ordered(g, topological_sort(g));
var renderer = new Graph.Renderer.Raphael('canvas', g, width, height);
});
</script>
</head>
<body>
<div id="canvas"></div>
</body>
</html>
结果是这样的视图:
这很好,但我需要将每个标题更改为这样的链接:@Html.ActionLink("Projet", "Modify_Project")
我怎样才能修改我的代码片段来完成这个任务?