Question

I am using dynatree and added a custom hoverover menu with links to pages; however, I cannot figure out why my links to the other pages aren't firing..

Here is my code for the tree:

<script type="text/javascript">
        $(function() {
            $("#catTree2").dynatree({
                checkbox: false,
                selectMode: 3,
                 children: [
                    {title: "First Year", isFolder: true,
                            children: [
                        {title: "ESUNRS 110 (Intro to Nursing I)"},
                        {title: "ESUNRS 112 (Intro to Nursing II)"},
                        {title: "ESUNRS 120 (Pharmacology in Nursing)"} ]},     
                    {title: "Second Year", isFolder: true,
                            children: [
                        {title: "ESUNRS 200 (Seminar I)"},
                        {title: "ESUNRS 201 (Seminar II)"},
                        {title: "ESUNRS 220 (Nursing of Adults I)"},
                        {title: "ESUNRS 221 (Nursing of Adults II)"},
                        {title: "ESUNRS 224 (Child and Mental Health Nursing I)"},
                        {title: "ESUNRS 225 (Child and Mental Health Nursing II)"} ]},  
                    {title: "Third Year", isFolder: true,
                            children: [
                        {title: "ESUNRS 300 (Seminar III)"},
                        {title: "ESUNRS 320 (Maternal-Newborn Nursing)"},
                        {title: "ESUNRS 322 (Management in Nursing)", isFolder: true,
                            children: [
                            {title: "Example Questions"} ]}, ]},        
                    ],
                onCustomRender: function (node) {
                    var html = "<span class='dynatree-title' href='#'>";
                        html += "<span class='td'>";
                        html += node.data.title;
                        html += "</span>";
                        html += "<span class='td'>";
                        html += "<ul id='options'>";
                        html += "<li class='image'>";
                        html += "<img src='/Icons/cog.png' alt='Options Menu'/>";
                        html += "<ul class='optionsMenu' style='top:20px;right:-119px;'>";
                        html += "<li>";
                        html += "<a href='#' class='createFolderOpen'>";
                        html += "New Folder";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='#' class='editFolderOpen'>";
                        html += "Edit Folder";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='#' class='deleteFolderOpen'>";
                        html += "Delete Folder";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='#' class='shareFolderOpen'>";
                        html += "Share Folder";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "Create New Question";
                        html += "<ul style='top:136px;right:-120px;'>";
                        html += "<li>";
                        html += "<a href='http://74.39.250.15/questions_create.asp'>";
                        html += "Multiple Choice";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='questions_create_tf.asp'>";
                        html += "True/False";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='questions_create_essay.asp'>";
                        html += "Essay";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='questions_create_fitb.asp'>";
                        html += "Fill in the Blank";
                        html += "</a>";
                        html += "</li>";
                        html += "</ul>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='questions_import.asp'>";
                        html += "Import Questions";
                        html += "</a>";
                        html += "</li>";
                        html += "<li>";
                        html += "<a href='#' class='exportQuestionsOpen'>";
                        html += "Export Questions";
                        html += "</a>";
                        html += "</li>";
                        html += "</ul>";
                        html += "</li>";
                        html += "</ul>";
                        html += "</span>";
                        html += "<span class='td'>";
                        html += "55";
                        html += "</span>";
                        html += "</span>";
                        return html;
                },
                //children: treeData,
                onSelect: function(select, node) {
                    // Get a list of all selected nodes, and convert to a key array:
                    var selKeys = $.map(node.tree.getSelectedNodes(), function(node) {
                        return node.data.key;
                    });
                    $("#echoSelection4").text(selKeys.join(", "));

                    // Get a list of all selected TOP nodes
                    var selRootNodes = node.tree.getSelectedNodes(true);
                    // ... and convert to a key array:
                    var selRootKeys = $.map(selRootNodes, function(node) {
                        return node.data.key;
                    });
                    $("#echoSelectionRootKeys4").text(selRootKeys.join(", "));
                    $("#echoSelectionRoots4").text(selRootNodes.join(", "));
                },
                onDblClick: function(node, event) {
                    node.toggleSelect();
                },
                onKeydown: function(node, event) {
                    if (event.which == 32) {
                        node.toggleSelect();
                        return false;
                    }
                }
            });
        });
</script>

why do my links not work?

Was it helpful?

Solution

A bit old but I use :

onCustomRender: function(node) {
var html = "<a href='xxxxx?FileId=" + node.data.key + "'>";                             
html += xxxxxxxxxxxx+"</a>";
return html;
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top