TX Text Control .NET Server

ContextMenuItem Object

Object|Introduced in 31.0

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

PropertyDescription
clickHandlerOptional. The custom menu item's click handler callback function.
dropDownIsScrollableOptional. Set this to true if the item's child menu should be scrollable. The default value is false.
imageUrlOptional. 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.
isCheckedOptional. Specifies whether the menu item has a check mark symbol in front of it. The default value is false.
isEnabledOptional. Specifies whether the menu item is enabled or not. The default value is true.
itemsOptional. The child menu items.
textThe menu item text. Set this to an empty string to add a horizontal separator line.