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:
- A DOM element.
- A CSS selector.
- An
ElementRef
class. - A
kendoContextMenuTargetContainer
.
Filtering the Targets
You can filter the targets within a container for which the ContextMenu will open.
- Set the
target
input to the container element. - Set the
filter
property to a CSS selector which matches the elements for which the ContextMenu will open.
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.
Directives
The ContextMenu allows you to associate its target elements with data by using its kendoContextMenuTargetContainer
and kendoContextMenuTarget
directives.
- Set
kendoContextMenuTargetContainer
to theroot
element. - 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.