dcane
Junior Member
Posts: 6
Registered: 8/14/2003
Member Is Offline
|
| posted on 8/14/2003 at 03:44 PM |
|
|
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
|
|
|
rock
Moderator
Posts: 687
Registered: 4/15/2003
Member Is Offline
|
| posted on 8/15/2003 at 07:32 AM |
|
|
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.
|
|
|
dward
Junior Member
Posts: 4
Registered: 11/11/2003
Member Is Offline
|
| posted on 11/11/2003 at 07:16 AM |
|
|
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
|
|
|
quietfart
Junior Member
Posts: 4
Registered: 9/13/2004
Member Is Offline
|
| posted on 11/6/2004 at 06:15 AM |
|
|
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
|
|
|