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:44
use mm_insertItem in menu without any item initialy
Poster: NiN
Dated: Tuesday January 16 2007 - 21:22:06 GMT
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
Poster: Ruth
Dated: Wednesday January 17 2007 - 5:49:45 GMT
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.
http://www.milonic.com/forum/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
Poster: NiN
Dated: Wednesday January 17 2007 - 15:09:29 GMT
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