i just started using this menu and trying to convince my client to get this, but to convince them, I am just trying to create a prototype oif thier requirement.
The requirement is to create a menu using nested loops... may be there is an alternative approach, if so suggest me.
i am writing a code where i create a bunch of Main menus and each menu having bunch of sub menu items.. the code that I am using is
---------------------
Code: Select all
with(mainmenu=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=10;
for (i=0; i<20; i=i+2){
Name = "Menu" + i;
j = i+1;
var ShowName = "Menu" + j;
aI("text="+Name+";url=http://milonic.com/;showmenu="+ShowName);
with(submenu=new menuname(ShowName)){
left=10;
orientation="horizontal";
style=menuStyle;
for (k=0; k<20; k = k+2){
SubName = "SubMenu" + k;
aI("text="+SubName+";url=http://milonic.com/;");
};
}
};
}
the output that i get with that code is
Menu0
submenu0 submenu2 ... submenu20 menu2 [see here that menu2 is added as submenu to Menu0, not as a separate menu item, which i am expecting]
but i want
[main menu]Menu 0, Menu 2, Menu 4 with each one having [submenu] "submenu 0 ... submenu20" menuitems as submenu.
so, could you please help me in building this type of menu dynamically in nested loops. I looked at the dynamic menus api, but am not sure whether that will help me out.
I would appreciate a snippet of code to achieve this.
Thanks
Reddy