DHTML Menu Builder [DynAPI 1.1]
<developers_edition>
Saturday April 12, 2008

 

 

WARNING: The information on this documentation will change as the development on this version of DHTML Menu Builder progresses.
It is VERY important that you always refer to the information provided in this document prior to testing new versions of the DynAPI code.


Helper Functions

objid dmbAPI_getItemByCaption(Caption, Frame, [ParentItem])


Description

Retrieves the id of an item whose caption is the text passed on the Caption parameter.
The returned id can be used with all functions that expect a parameter type of 'objid'. The function will return null if no item is found.

Code sample
var id = dmbAPI_getItemByCaption("My Command");
This sample demonstrates how to obtain a reference to a menu item based on its caption.

Code sample
var id = dmbAPI_getItemByCaption("Products", cFrame, 2);
This sample demonstrates how to obtain a reference to a toolbar item whose caption is "Products" and its located in the toolbar whose index is 2.

Code sample
var id = dmbAPI_getItemByCaption("Contact Us", mFrame, "MyGroup");
This sample demonstrates how to obtain a reference to a command whose caption is "Contact Us" and its located in the group whose name is "MyGroup".

Parameters

Caption (string) The item's Caption from which you want to retrieve its id.

Frame (object) The frame where the function should find the item.
The frame should be a window objects such as mFrame or cFrame. Window objects such as window, self and this may also be used. Full frame paths such as top.mainFrame can also be used.

This parameter can be ignored by either not specifying it or by passing null to the function. In this case the function will look on the mFrame and cFrame frames for the item.


ParentItem (string|integer) (Optional) This parameter can be used to control where the item should be found.
Pass the name of a group
(string) to limit the function to look for the item under that group.
Pass the ToolbarIndex
(interger) of a toolbar to limit the function to look for the item under that toolbar.

This parameter can be ignored by either not specifying it or by passing null to the function.