New to Kendo UI for Angular? Start a free 30-day trial

Target

The target input of the ContextMenu defines the item for which the component will open.

Configuration

You can set target to any of the following values:

Example
View Source
Change Theme:

Filtering the Targets

You can filter the targets within a container for which the ContextMenu will open.

  1. Set the target input to the container element.
  2. Set the filter property to a CSS selector which matches the elements for which the ContextMenu will open.
Example
View Source
Change Theme:

Changing Items for Specific Targets

Depending on the filtered target elements, you can change the items that are shown in the ContextMenu by using the popupOpen event.

Example
View Source
Change Theme:

Directives

The ContextMenu allows you to associate its target elements with data by using its kendoContextMenuTargetContainer and kendoContextMenuTarget directives.

  1. Set kendoContextMenuTargetContainer to the root element.
  2. Pass the directive to the target input of the ContextMenu.

You have to set the kendoContextMenuTarget directives to the specific elements within the container for which the ContextMenu will open.

Example
View Source
Change Theme: