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.
as-moduleBooleanSpecifies whether the initialization script of the component will be rendered as a JavaScript module.
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.
data-content-fieldStringSets the field of the data item that provides the content of the ContextMenu items.
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.
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.
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-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.
hover-delayDoubleSpecifies the delay in ms before the sub menus are opened/closed - used to avoid accidental closure on leaving.
on-activateStringThe name of the JavaScript function that will handle the activate event. Fires when a sub menu or the ContextMenu gets opened and its animation finished.
on-closeStringThe name of the JavaScript function that will handle the close event. Fires before a sub menu or the ContextMenu gets closed. You can cancel this event to prevent closure.
on-data-boundStringThe name of the JavaScript function that will handle the dataBound event. Fires when the ContextMenu is bound to the set DataSource.
on-deactivateStringThe name of the JavaScript function that will handle the deactivate event. Fires when a sub menu or the ContextMenu gets closed and its animation finished.
on-openStringThe name of the JavaScript function that will handle the open event. Fires before a sub menu or the ContextMenu gets opened. You can cancel this event to prevent opening the sub menu.
on-selectStringThe name of the JavaScript function that will handle the select event. Fires 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.
script-attributesIDictionary<String,Object>Sets the attributes that will be added to the script tag of the component's initialization script.
security-trimmingBooleanIndicates whether security trimming is enabled.
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