JavaScript.CoolDev.Com Support Forums
Any questions related to JavaScript menu and JavaScript tree menu by Javascript.CoolDev.Com
| Author |
Message |
parallon
Joined: 27 Jan 2006 Posts: 10
|
Posted: Tue Jun 05, 2007 7:55 pm Post subject: childless node collapse all other nodes??? |
|
|
Hello all. I have tried to find the answer to this but not sure exactly what I am looking for. I have a Parent node with no children, and if I click on it after expanding another tree, the other tree stays expanded since I am using the "Store Tree State" option. Is it possible to close all other trees when I click on the childless node?
Thanks in advance,
Parallon |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Wed Jun 06, 2007 12:33 pm Post subject: |
|
|
| You're using many trees on the same page, right? |
|
| Back to top |
|
 |
parallon
Joined: 27 Jan 2006 Posts: 10
|
Posted: Wed Jun 06, 2007 2:45 pm Post subject: |
|
|
No, it is just one tree. Similar to the following:
| Code: | Home
Corporate
- About Us
- Mission
- Careers
Facilities
- Maintenance
- Solutions
- ES&H
- Consolidation
- Projects
Contact Us |
So, if I click on Corporate, it opens that node, then I select "About Us" and all is good. Well, next, if I click on either "Contact Us" or "Home", then I will be taken to the correct page, but the "Corporate" node stays expanded. I hope this makes sense.
Thanks,
Parallon |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Wed Jun 06, 2007 2:56 pm Post subject: |
|
|
In one post you're mentioning "other trees", and in the next post you state that there is only one tree. That's confusing.
Try to set option #12 to true in you tree_format.js file:
| Code: | | true, // 12. single branch mode flag |
|
|
| Back to top |
|
 |
parallon
Joined: 27 Jan 2006 Posts: 10
|
Posted: Wed Jun 06, 2007 3:46 pm Post subject: |
|
|
Sorry for the confusion. I meant to say Nodes in the first post. As for option 12, it is already set to 'True'.
I set up a sample at the following site:
http://www.tmss.web-cmms.com/menu_test/default.asp
... and here is the Format.js
| Code: | var TREE_FORMAT = [
0, // 0. left position
0, // 1. top position
false, // 2. show buttons ("+" and "-" images)
[null, null, 'images/b.gif'], // 3. button images: collapsed state, expanded state, blank image
[0, 0, 0], // 4. size of buttons: width, height, indent amount for childless nodes
false, // 5. show icons ("folder" and "document")
["", "", ""], // 6. icon images: closed folder, opened folder, document
[0, 0], // 7. size of icons: width, height
[0, 0, 0, 25, 35, 45, 55, 65, 75], // 8. indent amount for each level of the tree
"", // 9. background color for the tree
'treeNodeSpec0', // 10. default CSS class for nodes
[null, 'treeNodeSpec0a', 'treeNodeSpec0b', null, null, null, null, null, null], // 11. individual CSS classes for levels of the tree
true, // 12. "single branch" mode
[0, 0], // 13. padding and spacing values for all nodes
false, // 14. "explorer-like" mode
[, , , , , , , 'images/line.gif', 'images/join.gif', 'images/joinbottom.gif'], // 15. images for "explorer-like" mode
[19, 16], // 16. size of images for "explorer-like" mode: width, height
true, // 17. store tree state into cookies
true, // 18. relative positioning mode
[150, 304], // 19. initial space for the relatively positioned tree: width, height
true, // 20. resize container of the relatively positioned tree
true, // 21. change background-color and style for selected node
["", "", ""], // 22. background color for unselected node, background color for selected node, class for selected node
150, // 23. text wrapping margin (typically the width of the menu)
"middle"// 24. vertical alignment for buttons and icons
]; |
See, if you click on 'Corporate' and then 'Project Management', the Corporate one will close, but if you click on either 'Home' or 'Contact Us', the other node will stay expanded.
Thanks for your time,
Parallon |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
|
| Back to top |
|
 |
parallon
Joined: 27 Jan 2006 Posts: 10
|
Posted: Wed Jun 06, 2007 4:14 pm Post subject: |
|
|
That worked perfectly. I was thinking that post was only for the image portion.
Thank you so much,
Parallon |
|
| Back to top |
|
 |
|
|