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:26
Get parent Item of a menu
Poster: mitch
Dated: Thursday November 22 2007 - 21:26:16 GMT
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
Re: Get parent Item of a menu
Poster: Ruth
Dated: Friday November 23 2007 - 20:07:16 GMT
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://www.milonic.com/menu_methods.php
Ruth
Re: Get parent Item of a menu
Poster: mitch
Dated: Monday November 26 2007 - 14:36:02 GMT
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.
Re: Get parent Item of a menu
Poster: Ruth
Dated: Monday November 26 2007 - 19:23:22 GMT
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://www.milonic.com/support/
Ruth