MenuBuilder
Defines the fluent interface for configuring the Menu component.
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Syntax:
public class MenuBuilder : WidgetBuilderBase<Menu, MenuBuilder>, IHtmlString
Inheritance: objectWidgetBuilderBase<Menu, MenuBuilder>MenuBuilder
Implements:
Inherited Members
Constructors
Initializes a new instance of the MenuBuilder class.
Methods
Sets the menu animation options.
public MenuBuilder Animation(Action<PopupAnimationBuilder> animationAction)
The animation settings.
Returns:Disables the menu animation.
Binds the menu to a list of objects. The menu will create a hierarchy of items using the specified mappings.
public MenuBuilder BindTo(IEnumerable dataSource, Action<NavigationBindingFactory<MenuItem>> factoryAction)
The data source.
factoryActionAction<NavigationBindingFactory<MenuItem>>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 Menu declaratively, use the Items(Action<MenuItemFactory>) method.
public MenuBuilder BindTo(IEnumerable<MenuItem> items)
The list of items
Returns:Binds the menu to a sitemap
public MenuBuilder BindTo(string viewDataKey, Action<MenuItem, SiteMapNode> siteMapAction)
The view data key.
siteMapActionAction<MenuItem, SiteMapNode>The action to configure the item.
Returns:Binds the menu to a sitemap.
public MenuBuilder 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 MenuBuilder BindTo<T>(IEnumerable<T> dataSource, Action<MenuItem, T> itemDataBound)
The data source.
itemDataBoundAction<MenuItem, 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 MenuBuilder DataContentField(string value)
The value for DataContentField
Returns:Sets the field of the data item that provides the icon class of the menu items.
public MenuBuilder DataIconClassField(string value)
The value for DataIconClassField
Returns:Sets the field of the data item that provides the icon name of the menu items.
public MenuBuilder DataIconField(string value)
The value for DataIconField
Returns:Sets the field of the data item that provides the image url of the menu items.
public MenuBuilder DataImageUrlField(string value)
The value for DataImageUrlField
Returns:Configure the DataSource of the component
public MenuBuilder DataSource(Action<HierarchicalDataSourceBuilder<object>> configurator)
The action that configures the DataSource.
Returns:Sets the DataSource ID of the component
public MenuBuilder 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 MenuBuilder DataSpriteCssClassField(string value)
The value for DataSpriteCssClassField
Returns:Sets the field of the data item that provides the text of the menu items.
public MenuBuilder DataTextField(string value)
The value for DataTextField
Returns:Sets the field of the data item that provides the url of the menu items.
public MenuBuilder DataUrlField(string value)
The value for DataUrlField
Returns:Specifies Menu opening direction.
public MenuBuilder Direction(MenuDirection value)
The desired direction.
Returns:Specifies Menu opening direction.
Configures the client-side events.
public MenuBuilder Events(Action<MenuEventBuilder> clientEventsAction)
The client events action.
Returns:Select item depending on the current URL.
public MenuBuilder 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.
Specifies the position of the icon in the Menu items using the text content as a reference.
public MenuBuilder IconPosition(IconPosition value)
The value for IconPosition
Returns:Defines the items in the menu
public MenuBuilder Items(Action<MenuItemFactory> addAction)
The add action.
Returns:If RootMenuItems setting is enabled - all root menus will be opened on click. Respectively, if SubMenuItems is enabled - all sub menus will be opened on click.
public MenuBuilder OpenOnClick(Action<MenuOpenOnClickBuilder> openOnClickAction)
Enables or disables the "open-on-click" feature.
Sets the menu orientation.
public MenuBuilder Orientation(MenuOrientation value)
The desired orientation.
Returns:Sets the menu popup collision detection.
public MenuBuilder PopupCollision(Action<PopupCollisionBuilder> popupCollisionAction)
The collision action. Can be "fit", "flip" or "fit flip".
Returns:Disables the menu popup collision detection.
If enabled, the Menu will display buttons that will scroll the menu items, when they cannot fit the Menu width or menu popups height. By default scrolling is disabled.
public MenuBuilder Scrollable(Action<MenuScrollableBuilder> scrollableAction)
If enabled, the Menu will display buttons that will scroll the menu items, when they cannot fit the Menu width or menu popups height. By default scrolling is disabled.
Defines the security trimming functionality of the component
public MenuBuilder SecurityTrimming(Action<SecurityTrimmingBuilder> securityTrimmingAction)
The securityTrimming action.
Returns:Enable/disable security trimming functionality of the component.
public MenuBuilder SecurityTrimming(bool value)
If true security trimming is enabled.
Returns: