| Author |
Message |
corto
Joined: 24 Feb 2005 Posts: 10
|
Posted: Thu May 11, 2006 1:31 pm Post subject: Dynamic menu question |
|
|
Hello!
How should I handle "collapseAll()" and other Javascript functions if I retrieve urls from database?
Usually, If I use "tree1_nodes.js", I can add Javascript to url like this:
<a href="link.html" onclick="javascript:void(tree1.selectNode(1));tree1.collapseAll();return true;">
But how do I do it with dynamic menu?
I'm using your PHP + MySQL CGI sample. |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Thu May 11, 2006 11:00 pm Post subject: |
|
|
| Actually, database matters are unrelated to collapseAll and such. These are completely independent layers. Please, explain your issue in some other terms. |
|
| Back to top |
|
 |
corto
Joined: 24 Feb 2005 Posts: 10
|
Posted: Fri May 12, 2006 9:52 am Post subject: |
|
|
Hello Alex,
Yes, my example wasn't very good.
I'm developing site here: http://www.palomuseot.fi/default.php
If you choose first link "Suomen palomuseot" tree expands ok. If you then click the last link "Etusivulle" which hasn't any sub pages, "Suomen palomuseot" stays open
It would be great if tree could collapse every time when main level links are clicked.
Should I include javascript somewhere? |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Fri May 12, 2006 1:04 pm Post subject: |
|
|
You're using "Single branch mode". In this mode clicking any node with children will collapse all other nodes. This is behavior by design.
If you want have same behavior for childless nodes, you should make them look like ones with children, e.g.:
| Code: | | ['My node', 'file.html', null, {format:{isFolder:true}}], |
|
|
| Back to top |
|
 |
corto
Joined: 24 Feb 2005 Posts: 10
|
Posted: Wed May 17, 2006 11:10 am Post subject: |
|
|
| Ok, how should I use your code when I retrieve urls from mysql database? |
|
| Back to top |
|
 |
AlexKunin Developer
Joined: 03 Jan 2003 Posts: 1191
|
Posted: Wed May 17, 2006 11:15 am Post subject: |
|
|
| Your server-side code generates TREE_NODES variable. So, {format:{isFolder:true}} must be inserted into some part of your server-side logic. I can't tell exact place until I see your code. |
|
| Back to top |
|
 |
|