Welcome Guest Search | Active Topics | Members

FileSystem Folder Hyperlink Options
jweber95
Posted: Tuesday, March 16, 2004 3:05:00 PM
Rank: Member
Groups: Member

Joined: 3/16/2004
Posts: 5
Points: 0
In the Version 2 Filesystem demo, is it possible to hyperlink folder names and have it expand its corresponding child node? Thanks.
Fedor
Posted: Tuesday, March 16, 2004 11:07:00 PM

Rank: Advanced Member
Groups: Administration , Member

Joined: 7/28/2003
Posts: 1,254
Points: -345
Location: WA, US
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;
}


Best regards,
Fedor Skvortsov
Users browsing this topic
Guest


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.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.