ContextMenuItem Object
Description
A context menu item.
Syntax
{
[isChecked: <boolean>],
[isEnabled: <boolean>],
text: <string>,
[imageUrl: <string>],
[items: <ContextMenuItem[]>],
[dropDownIsScrollable: <boolean>],
[clickHandler: <ContextMenuItemClickHandler>]
}Examples
The following example demonstrates ContextMenuItem in a practical document-editing workflow. A context menu item.
function inspectContextMenuItem(contextMenuItem) {
console.log("is checked:", contextMenuItem.isChecked);
console.log("is enabled:", contextMenuItem.isEnabled);
console.log("text:", contextMenuItem.text);
console.log("image url:", contextMenuItem.imageUrl);
}Members
Properties
| Property | Description |
|---|---|
| clickHandler | Optional. The custom menu item's click handler callback function. |
| dropDownIsScrollable | Optional. Set this to true if the item's child menu should be scrollable. The default value is false. |
| imageUrl | Optional. The menu item's icon image URL. Can be a base64 encoded image data URL (e. g. "data:image/png;base64,iVBORw0KG...") or any other valid image URL. |
| isChecked | Optional. Specifies whether the menu item has a check mark symbol in front of it. The default value is false. |
| isEnabled | Optional. Specifies whether the menu item is enabled or not. The default value is true. |
| items | Optional. The child menu items. |
| text | The menu item text. Set this to an empty string to add a horizontal separator line. |