Frames version - not dealing with 'disabled' items

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
gmd
Beginner
Beginner
Posts: 5
Joined: Fri Sep 22, 2006 9:23 pm

Frames version - not dealing with 'disabled' items

Post by gmd »

I am starting to use the frames version. I have set one of the main menu items to type=disabled. This item has a sub-menu but the sub-menu (which appears in the other frame) is still active. What do I need to do please to make this happen. When a user logs in, I intend to enable the main-menu item- and hopefully the sub_menu(s).
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

The root of the issue is that the frame system does not check to see if a menu item is disabled or not, it just opens the submenu. This can be fixed.

Two approaches:

(1) A change to the openSubmenu() function in mm_naveframe.js, to check to see if a menu item is disabled before opening the associated submenu.

(2) A wrapper function of your own design for the openSubmenu() function. You'd call your function from the main menu item's clickfunction property, instead of calling openSubmenu(). I.e., instead of calling openSubmenu() directly, you'd call a custom function that would first test to see if the menu item was disabled and, if not, call openSubmenu().

#1 would be preferred, because it would be a general solution for anyone who may have the same issue. #2 is easier, because the code would be under your control. You could try #2 now. Meantime, I'll see what I can do about #1.

Cheers,

Kevin
gmd
Beginner
Beginner
Posts: 5
Joined: Fri Sep 22, 2006 9:23 pm

Post by gmd »

thanks Kevin. I must admit that I don't understand your second point, not being a programmer so I guess that I will have to wait. Alternatively, I could use some php code on every page opened in the frame to check whether a user has logged on and then alter the state of the menus but I didn't want to do that.

Is this a similar problem to using mm_changeItemProperty on one page but after navigating away from it the menu item reverts to its original state?
Post Reply