Back To Start Of Archive
Taken From The Forum: Help & Support for DHTML Menu Version 5+
Forum Topic: Click to view post
Last Updated: Saturday July 14 2012 - 06:07:42
Add to existing menus? V5
Poster: nekcih
Dated: Thursday February 19 2004 - 17:16:57 GMT
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.
SOLUTION: Add to existing menus? V5
Poster: nekcih
Dated: Thursday February 19 2004 - 17:32:08 GMT
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://www.milonic.com/;");
}
----------------------------------------------------------------
You have to add to the menu before doing drawMenus().
Later all.