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.


Events Handling Functions

void dmbAPI_setOnClick(Item, URL, Target, SubGroup, Alignment)


Description

Sets the action of a menu item when clicked.
This event is usually used to add links and/or actions to menu items.

Code sample
var nc = dmbAPI_getItemByCaption("My Command");
dmbAPI_setOnClick(nc, "/contact/support.htm");
This sample demonstrates how to add a link to a menu item.
First we obtain a reference to the item we want to modify and then we call the dmbAPI_setOnClick function to set the URL.

Parameters

This function accepts different parameters depending on the value of the SubGroup paramater.

When SubGroup is false

Item (objid) The item whose state will be changed.

URL (string) The URL to which the browser will be redirected when the item is clicked.
This parameter can also contain a piece of JavaScript code. The code will be executed when the item is clicked.

Target (string) The frame where the URL should be loaded.
This parameter can be a full path to the frame, the frame name or one of these predefined strings: _self, _blank or _parent

SubGroup (boolean) False

Alignment (integer) Ignored

When SubGroup is true

Item (objid) The item whose state will be changed.

URL (string) Name of the group to be displayed when the item is clicked.

Target (string) Ignored

SubGroup (boolean) True

Alignment (integer) A value from 0 to 11 representing the alignment in which the submenu should be displayed
 
0 Bottom/Left
1 Bottom/Right
2 Top/Left
3 Top/Right
4 Left/Top
5 Left/Bottom
6 Right/Top
7 Right/Bottom
8 Center/Left
9 Center/Right
10 Center/Top
11 Center/Bottom