ContextMenuTagHelper
Kendo UI ContextMenu TagHelper ContextMenuTagHelper class.
Definition
Namespace:Kendo.Mvc.TagHelpers
Assembly:Kendo.Mvc.dll
Syntax:
[HtmlTargetElement("kendo-contextmenu")]
[RestrictChildren("items", new string[] { "popup-animation", "li", "hierarchical-datasource", "scrollable" })]
[OutputElementHint("ul")]
public class ContextMenuTagHelper : TagHelperBase, ITagHelper, ITagHelperComponent, IDataBoundWidget<HierarchicalDataSourceTagHelper>
Inheritance: objectTagHelperTagHelperBaseContextMenuTagHelper
Implements:
Inherited Members
Example:
@addTagHelper *, Kendo.Mvc
<kendo-contextmenu name="contextmenu" align-to-anchor="true">
</kendo-contextmenu>
Child Tags
Constructors
Initializes a new instance of the ContextMenuTagHelper class.
public ContextMenuTagHelper(IKendoHtmlGenerator generator)
Properties
Specifies that ContextMenu should be shown aligned to the target or the filter element if specified.
public bool? AlignToAnchor { get; set; }
The DOM element to which the ContextMenu will be appended. The element needs to be relatively positioned.
public string AppendTo { get; set; }
Specifies that sub menus should close after item selection (provided they won't navigate).
public bool? CloseOnClick { get; set; }
Copies and uses the styles from the anchor.
public bool? CopyAnchorStyles { get; set; }
Sets the field of the data item that provides the content of the ContextMenu items.
[HtmlAttributeName("datacontentfield")]
public string DataContentField { get; set; }
Sets the field of the data item that provides the image url of the ContextMenu items.
[HtmlAttributeName("dataimageurlfield")]
public string DataImageUrlField { get; set; }
The Id of the data source.
[HtmlAttributeName("datasource-id")]
public string DataSourceId { get; set; }
Sets the field of the data item that provides the sprite css class of the ContextMenu items.
[HtmlAttributeName("dataspritecssclassfield")]
public string DataSpriteCssClassField { get; set; }
Sets the field of the data item that provides the text of the ContextMenu items.
[HtmlAttributeName("datatextfield")]
public string DataTextField { get; set; }
Sets the field of the data item that provides the url of the ContextMenu items.
[HtmlAttributeName("dataurlfield")]
public string DataUrlField { get; set; }
Represents the menu item opening direction.
public ContextMenuDirection? Direction { get; set; }
Specifies ContextMenu filter selector - the ContextMenu will only be shown on items that satisfy the provided selector.
public string Filter { get; set; }
Specifies the delay in ms before the sub menus are opened/closed - used to avoid accidental closure on leaving.
public double? HoverDelay { get; set; }
The 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.
public string OnActivate { get; set; }
The 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.
public string OnClose { get; set; }
The name of the JavaScript function that will handle the dataBound event. Fires when the ContextMenu is bound to the set DataSource.
public string OnDataBound { get; set; }
The 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.
public string OnDeactivate { get; set; }
The 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.
public string OnOpen { get; set; }
The name of the JavaScript function that will handle the select event. Fires when a menu item gets selected.
public string OnSelect { get; set; }
Specifies the orientation in which the menu items will be ordered
public ContextMenuOrientation? Orientation { get; set; }
Specifies 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.
public string PopupCollision { get; set; }
Indicates whether security trimming is enabled.
public bool? SecurityTrimming { get; set; }
Specifies 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.
public string ShowOn { get; set; }
Methods
Gets the initialization script.
protected override string GetInitializationScript()
The initialization script.
Overrides:
public override Task ProcessAsync(TagHelperContext context, TagHelperOutput output)
Overrides:
Serializes the defined settings.
public override IDictionary<string, object> Serialize()
Overrides:
SerializeEvents method.
protected override Dictionary<string, object> SerializeEvents()
Overrides:
SerializeSettings method.
protected override Dictionary<string, object> SerializeSettings()
Overrides:
Writes the HTML output.
protected override void WriteHtml(TagHelperOutput output)
The TagHelper output.
Overrides: