Hi.
I have been using a tree menu system (see link below) very similar in appearance and in operation to dhtmlxtree for my personal website.
[url]http://globalsoftwarearchive.dynamicdns.co.uk:8080/beta2/tree/demoLarge.html[/url].
Whilst looking for scripts on various websites I stumbled across dhtmlx.com and was very impressed.
I have now downloaded dhtmlxAccordion (standard) and dhtmlxTree (standard) and am starting to play with the code.
Here is what i want dhtmlxTree to do:
- Make the “Folders” open/expand and close/retract with a single click on it’s name. See #1 below.
- Make the “Files” open in a frame with a single click on it’s name. See #2 below.
- Make the previous “Folder” close/retract when i open/expand another “Folder” on the same menu level. See #3 below.
Here is what i’ve got so far:
tree.attachEvent("onClick",function(id){
if(tree.getOpenState(id)!=1) tree.openItem(id);
document.frames["Name_of_Frame"].location.href=tree.getUserData(id,"url");
return true; });
}
After trawling through the samples, documentation, and this forum I have come up with the code above, but this still doesn’t fully complete what i want the dhtmlxTree to do.
Using the above code:
#1. The “Folders” will open/expand with a single click on the name. How do I make them close/retract in the same way?
#2. The “Files” open in the frame as long as there is a “url” in the XML file, However all the “Folders” also try to open something in the frame when i single click on them. How do I stop this happening?
#3. How do I make the “Folders” do this?
I am new to writing/modifying scripts (ASP, Javascript etc), so all the help and detail you can give me would be much appreciated.
Many thanks.