I have downloaded the static list-based tree and i am having problems inserting events at the lowest levels of the tree.
I get the part where the ShowHideNode function is called for the image and the <a> tag.
///////////////////////////////////
img.src = imageFolder + plusImage;
img.onclick = showHideNode;
if(subItems.length==0)img.style.visibility='hidden';else{
subItems[0].id = 'tree_ul_' + treeUlCounter;
treeUlCounter++;
}
var aTag = menuItems[no].getElementsByTagName('A')[0];
aTag.onclick = showHideNode;
//////////////////////////////////////
And i also get the swith between the default image and the sheet image.
menuItems[no].insertBefore(img,aTag);
menuItems[no].id = 'dhtmlgoodies_treeNode' + nodeId;
var folderImg = document.createElement('IMG');
if(menuItems[no].className){
folderImg.src = imageFolder + menuItems[no].className;
}else{
folderImg.src = imageFolder + folderImage;
}
////////////////////////////////////////////////////////////////////////
But i can't seem to add an event when there are no more nodes to hide or show. For example at the lowest levels of my tree i want to use the sheet image and display a floating window.
i tried:
folderImg.src = customFunctionCreateWindow(false);return false;
But i think that does not work because everytime someone clicks on a <li> item it calls showHideNode;
How can i specify that when there are no more nodes i would like to call another functions and do something like:
<li><a href="#" onclick="customFunctionCreateWindow(false);return false;">hello</a></li>
Please help!!!!!
Thanks,