|
home / documentation / reference / childid
ChildID
- Description:
- The MenuID of the child menu for this menu item.
- Value:
- A valid MenuID.
- Applies To:
- Menu Items.
- Browser Compatibility:
- ChildID is supported in all browsers.
- Comments:
- Having labeled each of your menus with MenuID, you can
then apply them as child menus to a menu item by including their MenuID
in the ChildID of the menu item. The following HM_f_SetItems
call adds four items to the menu hm_service. Note that the second
menu item has a child menu; the child menu has a MenuID of
hm_widgets:
HM_f_SetMenus({MenuID:"hm_service"});
HM_f_SetItems(
{MenuID:"hm_service",DisplayText:"Sprockets",LinkURL:"/spr/"},
{MenuID:"hm_service",DisplayText:"Widgets",ChildID:"hm_widgets"},
{MenuID:"hm_service",DisplayText:"Gadgets",LinkURL:"/gad/"},
{MenuID:"hm_service",DisplayText:"Misc",LinkURL:"/misc/"}
);
The actual child menus themselves needn't be defined before their
ids are referred to in menu item definitions. But if they have still
not been defined (via HM_f_SetMenus) before the
parent menu is actually created (after page load, or when it is
first called for, depending on CreateOnLoad) then no
child menu will be displayed for this menu item. ChildID
should be applied as a string, which means the value you supply should
always be in quotes.
ChildID is case sensitive.
- Examples:
// Ok:
ChildID:"hm_products",
ChildID:window.hmPrefix+"products",
// concatenate the user defined variable hmPrefix
// with "products" to arrive at the ChildID
// Incorrect:
ChildID:hm_products, // quotes required
ChildID:"10thMenu", // must begin with a letter
ChildID:"TopTen%", // % not allowed
ChildID:"Products Menu", // spaces not allowed
ChildID:'window.hmPrefix+"products"',
// no quoted expressions
- Default:
- ""
- See Also:
- MenuID,
ItemIDSuffix
|