Get parent Item of a menu

Having problems with DHTML Menu? There is usually somebody here who knows the answer.
Post Reply
mitch
Beginner
Beginner
Posts: 2
Joined: Thu Nov 22, 2007 9:28 pm

Get parent Item of a menu

Post by mitch »

Hello all. Bought the menu a few months ago, and am enjoying it quite a bit so far. My problem is as follows:

I have two menus. Every item on menu #1 shows menu #2. Then, when the user clicks the item on menu #2, I'm calling a javascript function. However, at this point I wish to know the parent item name (the item that was moused over to show menu #2) because this will be passed as a parameter to the javascript.

i.e. my javascript will be { someFunction(menu_2_item_chosen, menu_1_item_chosen) }

I know about this: var parentMenu=getParentMenuByItem(_itemRef). But that seems to get only the menu reference, not the actual item reference.

Any ideas are greatly appreciated! I tried searching around but couldn't find anything.

-Mitch
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Get parent Item of a menu

Post by Ruth »

Hi,

I don't know functions, so am not sure if this will help. There is a method and functions page and one of the things is
getParentItembyItem.

http://milonic.com/menu_methods.php

Ruth
mitch
Beginner
Beginner
Posts: 2
Joined: Thu Nov 22, 2007 9:28 pm

Re: Get parent Item of a menu

Post by mitch »

No this doesn't help because that function seems to only return the first parent menu from the static list.

i.e. if I have item1 with showmenu=submenu AND item2 with showmenu=submenu, then getParentItemByItem will return item1, always.

I want a function that behaves dynamically, revolving around the _itemRef global variable somehow.

Anywho, I've done some studying of the code / variables and I think I will be able to make my own wrapper function to accomplish what I need.

I'll post back if I have success.
User avatar
Ruth
 Team
 Team
Posts: 8763
Joined: Thu May 15, 2003 5:02 am
Location: Yucaipa, CA
Contact:

Re: Get parent Item of a menu

Post by Ruth »

Hi Mitch,

Posting back would be appreciated, to help any others. If you have a professional or above current license you can contact Milonic with a support ticket here, you'll need to be logged in under the name you used when you purchased the license and support.

http://milonic.com/support/

Ruth
Post Reply