Need Help - mm_insertItem - Insert items into existing menu
I took a look at the .NET control demo. It was nice but did not provide the funcitonality that I was look for. I ended up building a few controls of my own and a class library to handle all Milonic menu functions.
1. Yes, the static menu is available to all users. I reference this menu through an js include file, just like all of the samples.
2. Some users will have additional menu items that are custom for each user.
3. The custom items are tailored to the credentials of each user.
- The entire menu is in a database. It can be changed on the fly and the items therefore can be changed in real time.
1. Yes, the static menu is available to all users. I reference this menu through an js include file, just like all of the samples.
2. Some users will have additional menu items that are custom for each user.
3. The custom items are tailored to the credentials of each user.
- The entire menu is in a database. It can be changed on the fly and the items therefore can be changed in real time.
Hi,
I'm sorry to bug you, but I'm trying to understand what you are trying to do.
It seems as if, more or less, you want different menus dependant upon particular conditions.
I found a post I remembered from a long time ago, this isn't the menueditapi, but a person wanted the menu setup based on whether the user was logged in or not, I don't know if this will help or not either.
viewtopic.php?p=13544
I can't figure out how the menueditapi.js module is going to do what you want. You're saying that in effect, if I understand, you want a number of different menus, so you'd have to have different things in the in the menu_data.js file that use the menueditapi.js module to be, inserted, deleted etc. So, I woud think you had to have some way of telling the menu which things to use of those you have listed for the menueditapi.js module based on which conditions. If I'm correct, and I am probably way off base here, I think you'd have to have some kind fo function that sets up and uses whatever the conditions are, kind of like:
and so on
How many 'different' menus do you need? Maybe you could set up a function that loads a menu_data.js file based on the particular user, and then each file would have it's own mm_insert/delete/change stuff in it or not in it if that wasn't needed?
I'm just throwing out ideas here, maybe they will give someone an idea, then again maybe they are all wet!
Ruth
I'm sorry to bug you, but I'm trying to understand what you are trying to do.
It seems as if, more or less, you want different menus dependant upon particular conditions.
I found a post I remembered from a long time ago, this isn't the menueditapi, but a person wanted the menu setup based on whether the user was logged in or not, I don't know if this will help or not either.
viewtopic.php?p=13544
I can't figure out how the menueditapi.js module is going to do what you want. You're saying that in effect, if I understand, you want a number of different menus, so you'd have to have different things in the in the menu_data.js file that use the menueditapi.js module to be, inserted, deleted etc. So, I woud think you had to have some way of telling the menu which things to use of those you have listed for the menueditapi.js module based on which conditions. If I'm correct, and I am probably way off base here, I think you'd have to have some kind fo function that sets up and uses whatever the conditions are, kind of like:
Code: Select all
if userIsGen, then do not insert any item, else if userIsLev1, then
mm_insertItem('Main Menu',2,'text=New Item; else if userIsLev2 mm_insertItem('Main Menu',2,'text=New Item2;') ;
How many 'different' menus do you need? Maybe you could set up a function that loads a menu_data.js file based on the particular user, and then each file would have it's own mm_insert/delete/change stuff in it or not in it if that wasn't needed?
I'm just throwing out ideas here, maybe they will give someone an idea, then again maybe they are all wet!

Ruth
-
- Beginner
- Posts: 2
- Joined: Wed Jul 09, 2003 4:13 am
- Contact:
demo http://www.milonic.com/menueditapi.php does not work
The demo at http://milonic.com/menueditapi.php throws an "Object expected" error on line 255 which seems to be "_getDims();" in function mm_createNewMenus() when clicking "Create New Menu".
I'm using IE 6.
I'm using IE 6.
Hi,
I don't know which file you mean. If you mean the menueditapi.js module, then it's at http://milonic.com/menumodules.php You need to go down about 4 or 5 items or so.
If you mean that little demo it's here
http://milonic.com/menueditapi.php
Ruth
I don't know which file you mean. If you mean the menueditapi.js module, then it's at http://milonic.com/menumodules.php You need to go down about 4 or 5 items or so.
If you mean that little demo it's here
http://milonic.com/menueditapi.php
Ruth
Can you look at the code I posted earlier in this thread and tell me why it does not work?Ruth wrote:Hi,
I don't know which file you mean. If you mean the menueditapi.js module, then it's at http://milonic.com/menumodules.php You need to go down about 4 or 5 items or so.
If you mean that little demo it's here
http://milonic.com/menueditapi.php
Ruth
Thanks Ruth. I'll be eagerly checking this thread.Ruth wrote:I'm sorry, I can't. I'm trying to get some direction from Milonic since I can't get the module to work at all. But, I've always had trouble with it and that is not the module, it is the lack of knowledge on my part.
As soon as I get some information I'll let you know.
Ruth

Hi
you have to log in, then load
http://milonic.com/menuvinfo.php
and download the version 5_746 which is for instance zipped. This contains a folder extras and the subfolder dynamic_menus
Michael
you have to log in, then load
http://milonic.com/menuvinfo.php
and download the version 5_746 which is for instance zipped. This contains a folder extras and the subfolder dynamic_menus
Andy wrote:
Hi,
I have added a new directory to the menu downloads called dynamic_menus.
Michael
To go along with the rest of this thread ... we are using mm_insertItem quite extensively. We were having some issues with menus appearing and disappearing with the use of that function but those issues appear to be cleared up using the latest menu build.
Now whenever mm_insertItem is used the menus are displaying on-screen and working fine but each page using that function is throwing a script error:
Error: Object expected
This error appears to trace back to the mm_menueditapi.js function _rbMenus(m) at the line:
if(_gm.style.visibility==$6){
any ideas on what may be causing this? it is happening on any and call pages using the mm_insertItem and the menu files are all the latest available.
thanks
Now whenever mm_insertItem is used the menus are displaying on-screen and working fine but each page using that function is throwing a script error:
Error: Object expected
This error appears to trace back to the mm_menueditapi.js function _rbMenus(m) at the line:
if(_gm.style.visibility==$6){
any ideas on what may be causing this? it is happening on any and call pages using the mm_insertItem and the menu files are all the latest available.
thanks
some observations on use of the dynamic menu module ... not sure if this will help anyone, but it gave me some problems.
you can pre-create menus and then change them dynamically. at page load time, you could have code like
and then later add menu elements with code like
my problems in understanding this were 2-fold ... first, the mm_insertItem() function accepts as it's 1st parameter a menuRef number , not a string like the sample syntax in mm_menueditapi.js. second, if attempting to pre-create a menu as above, the menu MUST have at least one menu item in order to be created by drawMenus() ... hence the "TEMP" aI() function call above.
knowing this has made it simple to maintain 4+ separate dynamic menus on a page simultaneously.
you can pre-create menus and then change them dynamically. at page load time, you could have code like
Code: Select all
with (menuCOSymbols = new menuname("Checkout Symbols")) {
style=menuStyle;
alwaysvisible=0;
aI("text=TEMP;offclass=menuNews");
}
drawMenus();
Code: Select all
mm_insertItem(getMenuByName("Checkout Symbols"), 1, "text=ASDF;url=javascript:menuDeleteCheckoutSymbol('ASDF');offclass=menuNews");
knowing this has made it simple to maintain 4+ separate dynamic menus on a page simultaneously.