use mm_insertItem in menu without any item initialy

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
NiN
Beginner
Beginner
Posts: 2
Joined: Thu Jan 11, 2007 3:52 pm

use mm_insertItem in menu without any item initialy

Post by NiN »

Hello,

I try to add dynamically an item into a menu by using mm_insertItem.
This works fine if the menu where I try to insert the item has already an item, but does not work if not.

For examples this is my menu:
with(new menuname("OBJS_THIAPL")){
style = sub1Style;
margin=AllMargin;
}
After an action of the user I try to call:
mm_insertItem('OBJS_THIAPL',0,'text=my text;url=#;');

This does not work.
It works only if the menu is define like:
with(new menuname("OBJS_THIAPL")){
style = sub1Style;
margin=AllMargin;
aI(text= ;);
}
The problem with that is I have a blank item

Any ideas ?

thanks in advance
Regards
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Post by Ruth »

Hi,

This is the only information I've found on this. I do not use this module and am not really familiar with the various things in it.

viewtopic. ... 8115#38115

As per this post it seems that an item is required. I was wondering if you might be able to make that first dummy item a header item which means it won't have any mouseover/off change of the mouse.

I'm checking on some other things for this. For example there is the addMenus, and createMenus part of this api so maybe you have to set it up to create the menu and item at the same time. The problem is, that only seem to apply to a main menu, that is, a menu you position. So, I'm checking on how you'd add a submenu and an item to it.

Ruth
NiN
Beginner
Beginner
Posts: 2
Joined: Thu Jan 11, 2007 3:52 pm

Post by NiN »

Thanks for your quick response,

I use the collapsible menu and I found that when we add an item dynamicaly and we expand the menu, the item that we just added hide the following menu item.

So in order to correct those 2 problems I just reload the entire menu when I have to add an item dynamically.

Thanks again
Post Reply