Support Forum Softcomplex logo
About Us  | Services  | Download  | Order  | Support  | |
| Search | Today's Posts | Stats | Board Rules | Not logged in [ Login | Register ]
go to bottom
Last active: Never

Printable Version | Subscribe | Add to Favourites   Post new thread
Author: Subject: ASP Filesystem listing - need name only, not link
lwoods
Junior Member

Posts: 7
Registered: 1/23/2006
Member Is Offline
posted on 8/29/2007 at 02:33 PM Reply With Quote
ASP Filesystem listing - need name only, not link


I want to be able to select a file from the Tree, but I don't want a link generated. Possibly generate an OnClick with the filename being passed to a javascript that I would write.

How?

TIA
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 8/29/2007 at 03:13 PM Reply With Quote

you can call javascript from the link of the item without page reload. Here's the note from the documentation page:

- Any code appropriate for HREF attribute of the anchor (<a ..>) can be specified in link field of tree item (http://, ftp://, javascript:, etc.)

so you can basically do something like:

["Home", "javascript:myFunction('index.html')"]
View User's Profile View All Posts By User U2U Member
lwoods
Junior Member

Posts: 7
Registered: 1/23/2006
Member Is Offline
posted on 8/29/2007 at 06:50 PM Reply With Quote

Well, yes,...maybe. I need to have the filename "plugged into" the javascript call. Your examples shows pulling in a constant filename. At least I have tried various methods and can't force the object name. I even changed the ASP code and it looks like your javascript tree building code overrode my changes. Anyway, give me some more ideas....
View User's Profile View All Posts By User U2U Member
lwoods
Junior Member

Posts: 7
Registered: 1/23/2006
Member Is Offline
posted on 8/30/2007 at 02:03 PM Reply With Quote

I want to add a little more detail about what I am looking for...

I want to list the tree, then I want to know which file a person selected (clicked on) in the tree. This could be handled with an "onclick" event or I could handle it with a javascript function in an href link.

How?

TIA
View User's Profile View All Posts By User U2U Member
tigra
Administrator

Posts: 2049
Registered: 6/17/2002
Location: US, CO
Member Is Offline
posted on 8/30/2007 at 03:49 PM Reply With Quote

The code sample I provided answers your question about calling the function on item click:

["Home", "javascript:myFunction('index.html')"]

This code will call function myFunction with 'index.html' passed as parameter. With the items structure generated by the server side script you'll need to replace the static parameter with the asp output i.e.

["<%= Caption %>", "javascript:myFunction('<%= Filename %>')" ...

Those are the sample variable names, they may be different in your ASP implementation.
View User's Profile View All Posts By User U2U Member
Post new thread

Related Links:
Product Page
Product Demonstrations Live Demos
Multiple Trees
Frames Targeting
Icons and Styles Overloading
Event Handling
Performance Test
Version 1.2 features
Product Documentation Documentation
Documenation Page
Change Log
Support Forum Technical Support
Support Forum
Customer Care System
Order Now ORDER NOW!
Add to Cart
View Cart
 

Go To Top


Powered by XMB 1.9.1 Nexus
Developed By Aventure Media & The XMB Group © 2002-2004