ContextMenu

Example

Razor
<kendo-contextmenu>
    <hierarchical-datasource></hierarchical-datasource>
    <items></items>
    <li></li>
    <popup-animation></popup-animation>
    <scrollable />
</kendo-contextmenu>

ChildTags

Attributes

AttributeTypeDescription
nameStringSets the name of the component.
data-image-url-fieldStringSets the field of the data item that provides the image url of the ContextMenu items.
deferredBooleanSuppress initialization script rendering. Note that this options should be used in conjunction with DeferredScripts method.
is-in-client-templateBooleanWhen placing a Tag Helper within a Kendo Template, set the type to text/html and add the is-in-client-template="true" attribute.
align-to-anchorBooleanSpecifies that ContextMenu should be shown aligned to the target or the filter element if specified.
append-toStringThe DOM element to which the ContextMenu will be appended. The element needs to be relatively positioned.
as-moduleBoolean
close-on-clickBooleanSpecifies that sub menus should close after item selection (provided they won't navigate).
copy-anchor-stylesBooleanCopies and uses the styles from the anchor.
data-content-fieldStringSets the field of the data item that provides the content of the ContextMenu items.
data-source-idStringThe Id of the data source.
data-sprite-css-class-fieldStringSets the field of the data item that provides the sprite css class of the ContextMenu items.
data-text-fieldStringSets the field of the data item that provides the text of the ContextMenu items.
data-url-fieldStringSets the field of the data item that provides the url of the ContextMenu items.
directionContextMenuDirectionRepresents the menu item opening direction.
filterStringSpecifies ContextMenu filter selector - the ContextMenu will only be shown on items that satisfy the provided selector.
has-client-componentBoolean
hover-delayDoubleSpecifies the delay in ms before the sub menus are opened/closed - used to avoid accidental closure on leaving.
on-activateStringFires when a sub menu or the ContextMenu gets opened and its animation finished.
on-closeStringFires before a sub menu or the ContextMenu gets closed. You can cancel this event to prevent closure.
on-data-boundStringFires when the ContextMenu is bound to the set DataSource.
on-deactivateStringFires when a sub menu or the ContextMenu gets closed and its animation finished.
on-openStringFires before a sub menu or the ContextMenu gets opened. You can cancel this event to prevent opening the sub menu.
on-selectStringFires when a menu item gets selected.
orientationContextMenuOrientationSpecifies the orientation in which the menu items will be ordered
popup-collisionStringSpecifies how ContextMenu should adjust to screen boundaries. By default the strategy is "fit" for a sub menu with a horizontal parent or the root menu, meaning it will move to fit in screen boundaries in all directions, and "fit flip" for a sub menu with vertical parent, meaning it will fit vertically and flip over its parent horizontally. You can also switch off the screen boundary detection completely if you set the popupCollision to false.
sanitize-idBoolean
script-attributesIDictionary<String,Object>
security-trimmingBoolean
show-onStringSpecifies the event or events on which ContextMenu should open. By default ContextMenu will show on contextmenu event on desktop and hold event on touch devices. Could be any pointer/mouse/touch event, also several, separated by spaces.
targetStringSpecifies the element on which ContextMenu should open. The default element is the document body.
In this article
ExampleChildTagsAttributes
Not finding the help you need?
Contact Support