ContextMenuBuilder
Defines the fluent interface for configuring the ContextMenu component.
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Syntax:
public class ContextMenuBuilder : WidgetBuilderBase<ContextMenu, ContextMenuBuilder>, IHtmlString
Inheritance: objectWidgetBuilderBase<ContextMenu, ContextMenuBuilder>ContextMenuBuilder
Implements:
Inherited Members
Constructors
Initializes a new instance of the ContextMenuBuilder class.
Methods
Specifies that context menu would align to its anchor (target or filter).
Sets the Animation options.
public ContextMenuBuilder Animation(Action<PopupAnimationBuilder> animationAction)
The animation settings.
Returns:Toggles the ContextMenu Animation.
Which DOM element the ContextMenu will be appended to. The element needs to be relatively positioned.
public ContextMenuBuilder AppendTo(string value)
The value for AppendTo
Returns:Binds the menu to a list of objects. The menu will create a hierarchy of items using the specified mappings.
public ContextMenuBuilder BindTo(IEnumerable dataSource, Action<NavigationBindingFactory<ContextMenuItem>> factoryAction)
The data source.
factoryActionAction<NavigationBindingFactory<ContextMenuItem>>The action which will configure the mappings
Returns:Binds the menu to a list of items. Use if the menu items are being sent from the controller. To bind the ContextMenu declaratively, use the Items(Action<ContextMenuItemFactory>) method.
public ContextMenuBuilder BindTo(IEnumerable<ContextMenuItem> items)
The list of items
Returns:Binds the menu to a sitemap
public ContextMenuBuilder BindTo(string viewDataKey, Action<ContextMenuItem, SiteMapNode> siteMapAction)
The view data key.
siteMapActionAction<ContextMenuItem, SiteMapNode>The action to configure the item.
Returns:Binds the menu to a sitemap.
public ContextMenuBuilder BindTo(string viewDataKey)
The view data key.
Returns:Binds the menu to a list of objects. The menu will be "flat" which means a menu item will be created for every item in the data source.
public ContextMenuBuilder BindTo<T>(IEnumerable<T> dataSource, Action<ContextMenuItem, T> itemDataBound)
The data source.
itemDataBoundAction<ContextMenuItem, T>The action executed for every data bound item.
Returns:Specifies that sub menus should close after item selection (provided they won't navigate).
Sets the field of the data item that provides the content of the menu items.
public ContextMenuBuilder DataContentField(string value)
The value for DataContentField
Returns:Sets the field of the data item that provides the image url of the menu items.
public ContextMenuBuilder DataImageUrlField(string value)
The value for DataImageUrlField
Returns:Configure the DataSource of the component
public ContextMenuBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
The action that configures the DataSource.
Returns:Sets the DataSource ID of the component
public ContextMenuBuilder DataSource(string dataSourceId)
Configures the DataSource ID.
Returns:Sets the field of the data item that provides the sprite css class of the menu items.
public ContextMenuBuilder DataSpriteCssClassField(string value)
The value for DataSpriteCssClassField
Returns:Sets the field of the data item that provides the text of the menu items.
public ContextMenuBuilder DataTextField(string value)
The value for DataTextField
Returns:Sets the field of the data item that provides the url of the menu items.
public ContextMenuBuilder DataUrlField(string value)
The value for DataUrlField
Returns:Specifies ContextMenu opening direction.
public ContextMenuBuilder Direction(ContextMenuDirection value)
The desired direction.
Returns:Specifies ContextMenu opening direction.
public ContextMenuBuilder Direction(string value)
The desired direction.
Returns:Configures the client-side events.
public ContextMenuBuilder Events(Action<ContextMenuEventBuilder> clientEventsAction)
The client events action.
Returns:Specifies the filter selector. The ContextMenu will be shown only for the elements that match the selector.
Select item depending on the current URL.
public ContextMenuBuilder HighlightPath(bool value)
If true the item will be highlighted.
Returns:Specifies the delay in ms before the menu is opened/closed - used to avoid accidental closure on leaving.
Callback for each item.
public ContextMenuBuilder ItemAction(Action<ContextMenuItem> action)
Action, which will be executed for each item.
Returns:Defines the items in the menu.
public ContextMenuBuilder Items(Action<ContextMenuItemFactory> addAction)
The add action.
Returns:Enables or disables the "open-on-click" feature.
Sets the menu orientation.
public ContextMenuBuilder Orientation(ContextMenuOrientation value)
The desired orientation.
Returns:If enabled, the ContextMenu will display buttons that will scroll the ContextMenu items, when they cannot fit the viewport height. By default scrolling is disabled.
public ContextMenuBuilder Scrollable(Action<ContextMenuScrollableBuilder> scrollableAction)
If enabled, the ContextMenu will display buttons that will scroll the ContextMenu items, when they cannot fit the viewport height. By default scrolling is disabled.
Defines the security trimming functionality of the component
public ContextMenuBuilder SecurityTrimming(Action<SecurityTrimmingBuilder> securityTrimmingAction)
The securityTrimming action.
Returns:Enable/disable security trimming functionality of the component.
public ContextMenuBuilder SecurityTrimming(bool value)
If true security trimming is enabled.
Returns:Specifies ContextMenu triggering event.
Specifies ContextMenu target to bind to.