Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
jweber95  
#1 Posted : Tuesday, March 16, 2004 7:05:00 AM(UTC)
jweber95

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.
Fedor  
#2 Posted : Tuesday, March 16, 2004 3:07:00 PM(UTC)
Fedor

Rank: Advanced Member

Groups: Member, Administration, Moderator
Joined: 7/28/2003(UTC)
Posts: 1,508

Thanks: 3 times
Was thanked: 49 time(s) in 48 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
Users browsing this topic
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.