WebFX WebBoard
Message Thread:
View All Messages
Back to WebFX
 XTree - Change class based on whether element is a folder, Joshua Hoover, January 12, 2004
     Re:XTree - Change class based on whether element is a folder, Erik Arvidsson, January 13, 2004
         Re:XTree - Change class based on whether element is a folder, Joshua Hoover, January 13, 2004

Subject: Re:XTree - Change class based on whether element is a folder From: Erik Arvidsson Date: January 13, 2004
Search for class and className in the source code and you'll see that it is modified in several places. I recommend you add your own method called getClassName that returns the correct class name depending on the state and replace the hard coded class names to us this instead. This is how XTree 2 is doing it and it makes it a lot easier to customize.

erik


I'm trying to come up with a way to change the class attribute of the href tag based on whether an item is a folder or not. I've figured out how to do this to the point where when the tree loads, all folders are a different class than everything else. But, when I click on a folder to expand it and then click it again to close it up, the class appears to go back to default, which is not what I want. I want to be able to set something like this for a folder element and have it stay that way regardless of what state the folder is in (closed or expanded):

<a href="http://www.website.com/" class="folderClass">Folder</a>

All other elements would be something like this:

<a href="http://www.website.com/" class="regular">Item</a>

Any ideas on how I can achieve this?



Reply
Name: 
Email: 
Subject: 

Enter your reply to this message below. HTML tags are not supported but words that start with http://, ftp:// or mailto: are converted to links.


View All Messages
Back to WebFX