How do I open a treemenu by default?

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
dyma97
Beginner
Beginner
Posts: 6
Joined: Mon Dec 20, 2004 11:17 pm

How do I open a treemenu by default?

Post by dyma97 »

Is there a way to control which menu is opened (collapsible tree menu) via javaScript?

It seems I should be able to use treeMenuDisplay(), but I am not sure what to pass. This is what I am currently trying.

treeMenuDisplay(af_150, 'Show');

The result is Error: 'af_150' is undefined

My site is:

http://askafpc--pro.custhelp.com/cgi-bi ... prods6=157

There are any number of different tree menus that can be displayed based on which item is selected from the top menus.

I would like to dynamically open menus when the page is loaded based on the parameters that are passed. I can handle writing the correct js call via PHP as long as I know the correct parameters. Additionally, if I need to pen a menu that is "level 3" would I need to open its parent menu(s) first?

Thanks for everyone's help.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not sure this will help, since you are way above my level of understanding, but there is a function for the regular menu that auto opens subs when the page to which they are linked are open. Maybe that would give you some direction?

Ruth
dyma97
Beginner
Beginner
Posts: 6
Joined: Mon Dec 20, 2004 11:17 pm

Post by dyma97 »

Ruth,

That's not exactly what I am looking for although it is useful for a different issue I am having.

I guess the simplified question is, does anyone know what function opens a tree submenu and the parameters it requires?

The followup to this is if I make a call to open a nested menu, will it's parents open as well? I'm sure that once the first question is answered, the second will be evident.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

I'm not a function person, but I think if you open the treemenu.js file you will see the function used to open the submenus. It starts with

Code: Select all

function treeMenuDisplay(_mnu,_show){                      // This function hides or shows the menu
and then has a bunch of stuff after that.

Ruth
stuart
Advanced
Advanced
Posts: 14
Joined: Sat Aug 20, 2005 7:35 pm

Post by stuart »

I believe the treeMenuDisplay function is looking for an integer as its first parameter being the integer value of the menu

I am haveing problems getting this to work as well.

Did you every get a solution to this?

I don't get any errors but the function appears to do nothing.

Stuart
starmetheus
Advanced
Advanced
Posts: 11
Joined: Wed Oct 13, 2004 11:03 pm

Post by starmetheus »

the new version of treemenu.js seems to take care of this.

from the release notes:
Added new methods to the treemenu.js module, openBranchByName(), closeBranchByName(), clickBranch(), openAllBranches and closeAllBranches() modules, documentation to follow

I tried using openBranchByName() and it worked like a charm.
indra
Advanced
Advanced
Posts: 15
Joined: Sun May 19, 2002 8:23 pm

Post by indra »

I plan to use the treemenu (collapsible menu) on our website. I showed it to my manager and he had 2 requests: allow users to expand all and once it's all expanded, it should remained expanded when navigating to other pages.
The openAllBranches may take care the first request. Is there a way to have collapsible menu to remain open (all branches) until the click a link to close all?

Thank you

starmetheus wrote:the new version of treemenu.js seems to take care of this.

from the release notes:
Added new methods to the treemenu.js module, openBranchByName(), closeBranchByName(), clickBranch(), openAllBranches and closeAllBranches() modules, documentation to follow

I tried using openBranchByName() and it worked like a charm.
Migru
Milonic Guru
Milonic Guru
Posts: 669
Joined: Tue Nov 01, 2005 8:22 pm
Location: Hamburg - Germany
Contact:

Post by Migru »

Hi

look at this please

http://milonic.com/treemenu/tree/

though its the tree - sample (and not the collapsible) the technique required for opening and closing might be the same.

Michael
indra
Advanced
Advanced
Posts: 15
Joined: Sun May 19, 2002 8:23 pm

Post by indra »

I had looked at the sample. I know how to open all branches. Once it's open I want it to remain open as users navigate to other pages. Thanks for trying.


Migru wrote:Hi

look at this please

http://milonic.com/treemenu/tree/

though its the tree - sample (and not the collapsible) the technique required for opening and closing might be the same.

Michael
Post Reply