Advertisement

events at lowest level of static list-based tree

Moderators: Calcifer, slothy

events at lowest level of static list-based tree

Postby Roselyne » Thu Aug 24, 2006 10:13 pm

Hello Everyone,

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, :roll:
Roselyne
 
Posts: 26
Joined: Thu Aug 24, 2006 9:55 pm
Location: knoxville,tn

Return to Folder tree questions

Who is online

Users browsing this forum: No registered users and 6 guests

cron