Rank: Member
Groups: Member
Joined: 3/16/2004(UTC) Posts: 5
|
In the Version 2 Filesystem demo, is it possible to hyperlink folder names and have it expand its corresponding child node? Thanks.
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 7/28/2003(UTC) Posts: 1,660
Thanks: 5 times Was thanked: 76 time(s) in 74 post(s)
|
To show hyperlink to content of folder you need to change lines 46-50 in Files.asp from: Code:For Each objSubDirectory In objDirectory.SubFolders
'Create tree node
Response.Write "oNodes[" & I & "] = new node('" & objSubDirectory.Name & "', null, 'folder', 'main', '" & "Files.asp?path=" & Server.URLEncode(strPath & objSubDirectory.Name & "/") & "');"& vbNewLine
I = I + 1
Next
to Code:For Each objSubDirectory In objDirectory.SubFolders
'Create tree node
Response.Write "oNodes[" & I & "] = new node('" & objSubDirectory.Name & "', 'ShowFolderContent.asp?path=" & Server.URLEncode(File.Name) & "', 'folder', 'main', '" & "Files.asp?path=" & Server.URLEncode(strPath & objSubDirectory.Name & "/") & "');"& vbNewLine
I = I + 1
Next
and implement yourself ShowFolderContent.asp page which will show the content of folder. To add expanding tree on click you should add actionOnClick handler on lines 260 in toc.asp: Code:oA = document.createElement("a");
//It should be like actionOnClick('tnXXXX')
oA.onclick = new Function("actionOnClick('tn" + nodeId + "')");
if (sHref!=""){
//Combine full path from baseHref and relative path
//If you want to use full pathes (not relative) just
//assing to baseHref empty string
oA.href = oData.baseHref + sHref;
}
Edited by user Monday, December 24, 2007 6:11:37 PM(UTC)
| Reason: Not specified |
Best regards, Fedor Skvortsov
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.