Hi All, menus in Nested Loops

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
rajereddy
Beginner
Beginner
Posts: 4
Joined: Tue Aug 28, 2007 3:58 pm

Hi All, menus in Nested Loops

Post by rajereddy »

Hi All,

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
rajereddy
Beginner
Beginner
Posts: 4
Joined: Tue Aug 28, 2007 3:58 pm

could you please help me ?

Post by rajereddy »

Hi Andy/ Ruth,

Could you please let me know what API should I use? should I be using mm_inseritem() etc... i tried to use those with no sucess.
rajereddy
Beginner
Beginner
Posts: 4
Joined: Tue Aug 28, 2007 3:58 pm

Hmm :-(

Post by rajereddy »

Could some one please help regarding this?
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

I have posted this to Milonic. I can't help because what you're doing is way beyond me.

There is a module called menueditapi.js on this page.

http://milonic.com/menumodules.php

I suggest you also contact Milonic from the main site http://milonic.com

I'm sorry I can't help....

Ruth
rajereddy
Beginner
Beginner
Posts: 4
Joined: Tue Aug 28, 2007 3:58 pm

Thanks for your reply

Post by rajereddy »

Ruth,

THanks for your reply. I will contact Milonic as said.

Thanks
Post Reply