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.


Adding/Removing Items Functions

objid dmbAPI_addTBItem(ToolbarIndex, Caption)


Description

Adds a new toolbar item to the toolbar specified by the ToolbarIndex parameter.
The function will return the id of the newly added item.

Code sample
var tbi = dmbAPI_addTBItem(1, "New Item");
This sample demonstrates how to add a toolbar item to an existing toolbar.
In this sample, the toolbar item will be added to the toolbar whose index is 1 and the new toolbar item's caption will be "New Item".

Note that this function does not automatically creates a group, it just creates the toolbar item.
If you want to add a toolbar item and display commands when the toolbar item is selected you will have to create a group and attach it to this toolbar item. Here's a small sample on how to do this:

Code sample
var tbi = dmbAPI_addTBItem(1, "New Item");
dmbAPI_addGroup("MyNewGroup");
dmbAPI_setOnMouseOver(tbi, "MyNewGroup", '', true, 4);

Parameters

ToolbarIndex (integer)A number from 1 to the number of toolbars.