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: How can I add an Expand Collapse +/- on the root node?
dcane
Junior Member

Posts: 6
Registered: 8/14/2003
Member Is Offline
posted on 8/14/2003 at 03:44 PM Reply With Quote
How can I add an Expand Collapse +/- on the root node?


Hello there. Using the TTM Pro and love it. My questions are regarding the root node. My goal is to have consistent +/- for all nodes including the root node. How can I accomplish this? The inconsistency is that users can double click the root node to roll-up everything, but cannot use a +/- control to do this.

Additionally, is there a way to prevent the double-click action from expanding/collapsing?

Thanks in advance!

Dan Cane
View User's Profile View All Posts By User U2U Member
rock
Moderator

Posts: 687
Registered: 4/15/2003
Member Is Offline
posted on 8/15/2003 at 07:32 AM Reply With Quote

This issue has already been discussed.
Please, see http://www.softcomplex.com/forum/viewthread.php?tid=784
As for your second question: no, there is no way to disable doubleclick action without modifying core script.
View User's Profile View All Posts By User U2U Member
dward
Junior Member

Posts: 4
Registered: 11/11/2003
Member Is Offline
posted on 11/11/2003 at 07:16 AM Reply With Quote

Hi,

Actually there is a way to prevent root nodes from "rolling up" without changing tree.js. Just define this function in any of the other files.

function rootNoClose() { return false }

Then add this item scope argument to your root nodes.

{'hc':'rootNoClose'}

e.g.
var TREE_ITEMS = [
['Home', 0, {'hc':'rootNoClose'},
['ChildNode_1', 'example.com', //...etc

Now the "Home" node will not close no matter how many times you click on it.

Also, if you add this next function, nodes will only require one click to open.

function onItemSelectHandler (o_item) {
if (o_item.a_children)
o_item.o_root.toggle(o_item.n_id)

return true;
}

Don't forget to add this to your tree_tpl.js file.

'onItemSelect':'onItemSelectHandler'

Enjoy,
Dan
View User's Profile View All Posts By User U2U Member
quietfart
Junior Member

Posts: 4
Registered: 9/13/2004
Member Is Offline
posted on 11/6/2004 at 06:15 AM Reply With Quote
i still can't get the single-click-to-open to work


hey dan,

thanks for being ultra helpful. however i am still too much of a doofus to get the single-click-to-open to work.

i'm putting the 'onItemSelect':'onItemSelectHandler' at the bottom of the tree_tpl.js file. and then after the }; in the same file, at the very end, i'm inserting the code that you put out here, the function onItemSelectHandler etc. i just copied it verbatim and then the whole tree just decides to not show up. am i missing something?

thanks,
Q
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