Add to existing menus? V5

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
nekcih
Beginner
Beginner
Posts: 8
Joined: Thu Feb 19, 2004 6:05 pm
Location: Phoenix, AZ
Contact:

Add to existing menus? V5

Post by nekcih »

Is is possible to add links to alreadying existing menus and then redraw them? For example here's my initial menu...

with(MyMenu=new menuname("Main Menu")){
style=menuStyle0;
menuwidth=141;
itemwidth=141;
alwaysvisible=1;
orientation="vertical";
position="relative";

aI("text=  Links;showmenu=Links;");
aI("type=header;separatorsize=1;separatorpadding=5"); // separator
}

After doing this is there any way to add another aI() to the menu? Like this...

with(menuname["Main Menu"]){
aI("text=Added Later;url=http://www.bannerhealth.com/;");
}

I'm rebuilding the menu into a .net component for our intranet and I need to be able to write in different parts of a menu at different times in the code.

Any suggestions would be much appreciated.
Thanks.
nekcih
Beginner
Beginner
Posts: 8
Joined: Thu Feb 19, 2004 6:05 pm
Location: Phoenix, AZ
Contact:

SOLUTION: Add to existing menus? V5

Post by nekcih »

Yah! I figured it out. Here's how you do it...

----------------------------------------------------------------
var MyMenu=new menuname("Main Menu");

with(MyMenu){
style=menuStyle0;
menuwidth=141;
itemwidth=141;
alwaysvisible=1;
orientation="vertical";
position="relative";

aI("text= Links;showmenu=Links;");
aI("type=header;separatorsize=1;separatorpadding=5"); // separator
}
----------------------------------------------------------------

Then somewhere later in my code...

----------------------------------------------------------------
with(MyMenu){
aI("text=Added Later;url=http://milonic.com/;");
}
----------------------------------------------------------------

You have to add to the menu before doing drawMenus().
Later all.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Thanks, Mark for posting the solution when you figured it out. It really helps those of us who are not real knowledgeable...much better than the 'nevermind, I figured it out' one. :D

Ruth
Post Reply