Menu Blazor API
NameTypeDefaultDescription
AutoCloseDelayint100Determines delay (in milliseconds) before a Menu dropdown is closed when leaving the Menu with the mouse. Applicable only when selectionMode is 'mouseenter'.
AutoFocusOnMouseenterboolfalseIf set to true, on mouseenter, the element receives focus automatically.
CheckableboolfalseAllows top-level Menu items (immediate children of the Menu) to be checkable. Sublevels are controlled by setting checkable to the respective Smart-menu-items-group.
CheckboxesboolfalseSets or gets whether checkboxes and radio buttons can be displayed in the Menu. This property is applicable only to the Menu itself, and not its Smart-menu-item/Smart-menu-items-group subitems. See also the property checkable.
CheckModeMenuCheckModeMenuCheckMode.CheckboxSets the check mode of top-level Menu items (immediate children of the Menu). checkMode can be set to 'checkbox', 'radioButton', or a comma-separated list containing 'checkbox', 'radioButton', or 'none' (e.g. 'checkbox, radioButton, none, checkbox'). When set to a list, each value in the list is applied to groups of Menu items separated by an item with separator (item after the one with separator is the start of a new checkMode context). Sublevels are controlled by setting checkMode to the respective Smart-menu-items-group.
CloseActionMenuCloseActionMenuCloseAction.UpSets the document event which closes any open Menu drop downs (or the Menu itself when mode is 'dropDown').
DataSourceIEnumerable<object>N/ADetermines the data source that will be loaded to the Menu. The data source represents an array of objects with the following properties:
  • label - a string representing the text content of the item.
  • value - the value of the item.
  • shortcut - a string representing a shortuct for the item. It will be displayed inside the item.
  • items - allows to define an array of sub menu items.
DisabledboolfalseEnables or disables element.
DisplayMemberstring"label"Determines the field in the data source that corresponds to an item's label.
DropDownAppendTostring N/ASets custom outer container, where all dropdown containers must be appended. By default they are inside the menu. The value of the property can be an HTML element or the id of an HTML element. In mode 'dropDown', the property dropDownAppendTo also controls the parent element of the whole Menu. The open method works relatively to the original place of the Menu in the DOM.
DropDownOverlayboolfalseIf this property is enabled, when an element's dropdown is opened, a transparent overlay is positioned between the dropdown and the rest of the document.
DropDownPositionMenuDropDownPositionMenuDropDownPosition.AutoDetermines the opening direction of Menu dropdowns.
ItemsIEnumerable<object>A getter that returns an array of all Menu items.
ItemsMemberstring"items"Determines the field in the data source that corresponds to an item group's subitems collection.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
MinimizeIconTemplatestring"null"Used to load a custom minimize icon from an HTMLTemplateElement object. The HTMLTemplateElement is selected by it's id.
MinimizeWidthintN/ADetermines the minimum width of the Menu at which it will switch from normal to minimized mode. If set to null, the Menu does not minimize automatically.
ModeMenuModeMenuMode.HorizontalDetermines the menu's display mode.
IsOpenedboolfalseOpens or closes thte menu when it's in 'dropDown' mode.
OverflowOverflowOverflow.AutoSets or gets the menu's scroll buttons behavior. Applicable only when dropDownAppendTo is not null.
PreventCloseOnCheckboolfalseIf set to true, prevents the closing of the Menu or its dropdowns when Menu items are checked/unchecked.
ReadonlyboolfalseIf the element is readonly, users cannot interact with it.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
SelectionModeMenuSelectionModeMenuSelectionMode.ClickDetermines the menu's selection mode.
Themestring""Determines the theme. Theme defines the look of the element
UnfocusableboolfalseIf is set to true, the element cannot be focused.
ValueMemberstring"value"Determines the field in the data source that corresponds to an item's value.
NameTypeArgumentsDescription
AddItemvoidobject Item, object ParentAdds an item to the menu.Args: object Item - A smart-menu-item to add to the Menu.,object Parent - The smart-menu-items-group or its id or numeric path to add the item to.
AddItemvoidobject ItemAdds an item to the menu.
CheckItemvoidobject itemChecks an item.Args: object item - smart-menu-item/smart-menu-items-group or its id or numeric path.
ClearvoidN/AClears all Menu items.
ClickItemvoidobject itemClicks on an item programatically.Args: object item - smart-menu-item/smart-menu-items-group or its id or numeric path.
ClosevoidN/ACloses the Menu when "mode" is "'dropDown'".
CollapseItemvoidobject item, bool animationCollapses an item.Args: object item - smart-menu-item/smart-menu-items-group or its id or numeric path. If no item is passed, all open items are collapsed.,bool animation - If set to false, disables collapse animation even if animation is enabled for the element.
CollapseItemvoidN/ACollapses an item.
ExpandItemvoidobject item, bool animationExpands an item.Args: object item - smart-menu-item/smart-menu-items-group or its id or numeric path.,bool animation - If set to false, disables expand animation even if animation is enabled for the element.
ExpandItemvoidobject itemExpands an item.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
GetIsOpenedAsync()Task<bool>'N/A'Gets the &quot;IsOpened&quot; property as Task&lt;bool&gt;.
GetItemobjectstring idGets an item by its id or numeric path.Args: string id - The id or numeric path of an item
MaximizevoidN/AMaximizes the Menu.
MinimizevoidN/AMinimizes the Menu.
Openvoidint left, int topOpens the Menu when "mode" is "'dropDown'".Args: int left - Horizontal position,int top - Vertical position
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RemoveItemvoidobject itemRemoves an item from the menu.Args: object item - The smart-menu-item/smart-menu-items-group or its id or numeric path to remove.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
UncheckItemvoidobject itemUnchecks an item.Args: object item - smart-menu-item/smart-menu-items-group (or its id or numeric path)
NameTypeDescriptionEvent Detail
OnCloseEventCallback<Event>This event is triggered when the menu is closed. The event is fired only in "'dropDown'" "mode".N/A
Closedevent MenuClosedEventHandlerThis event is triggered when the menu is closed. The event is fired only in "'dropDown'" "mode".MenuClosedEventArgs
OnClosingEventCallback<Event>This event is triggered when the menu is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in "'dropDown'" "mode".dynamic trigger- Indicates whether the event was called from inside the element or programatically.
Closingevent MenuClosingEventHandlerThis event is triggered when the menu is about to be closed. The closing operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in "'dropDown'" "mode".MenuClosingEventArgs
OnCollapseEventCallback<Event>This event is triggered when a jqx-menu-items-group is collapsed.dynamic item- The menu item that was collapsed., string label- The label of the toggled item that was collapsed., dynamic value- The value of the toggled item that was collapsed., dynamic path- The path of the toggled item that was collapsed, e.g. '0.1', '1.1.2'., dynamic children- The children items of the toggled item that was collapsed.
Collapsedevent MenuCollapsedEventHandlerThis event is triggered when a jqx-menu-items-group is collapsed.MenuCollapsedEventArgs
OnCollapsingEventCallback<Event>This event is triggered when a jqx-menu-items-group is collapsing.dynamic item- The menu item that is going to be collapsed., string label- The label of the toggled item that is going to be collapsed., dynamic value- The value of the toggled item that is going to be collapsed., dynamic path- The path of the toggled item that is going to be collapsed, e.g. '0.1', '1.1.2'., dynamic children- The children items of the toggled item that is going to be collapsed.
Collapsingevent MenuCollapsingEventHandlerThis event is triggered when a jqx-menu-items-group is collapsing.MenuCollapsingEventArgs
OnExpandEventCallback<Event>This event is triggered when a jqx-menu-items-group is expanded.dynamic item- The menu item that was expanded., string label- The label of the toggled item that was expanded., dynamic value- The value of the toggled item that was expanded., dynamic path- The path of the toggled item that was expanded, e.g. '0.1', '1.1.2'., dynamic children- The children items of the toggled item that was expanded.
Expandedevent MenuExpandedEventHandlerThis event is triggered when a jqx-menu-items-group is expanded.MenuExpandedEventArgs
OnExpandingEventCallback<Event>This event is triggered before a jqx-menu-items-group is expanded.dynamic item- The menu item that is going to be expanded., string label- The label of the toggled item that is going to be expanded., dynamic value- The value of the toggled item that is going to be expanded., dynamic path- The path of the toggled item that is going to be expanded, e.g. '0.1', '1.1.2'., dynamic children- The children items of the toggled item that is going to be expanded.
Expandingevent MenuExpandingEventHandlerThis event is triggered before a jqx-menu-items-group is expanded.MenuExpandingEventArgs
OnItemCheckChangeEventCallback<Event>This event is triggered when a menu item check state is changed.dynamic item- The menu item which state was changed., string label- The label of the item which state was changed., dynamic value- The value of the item which state was changed., dynamic checked- The checked state of the toggled item. If false the item is not toggled.
ItemCheckChangedevent MenuItemCheckChangedEventHandlerThis event is triggered when a menu item check state is changed.MenuItemCheckChangedEventArgs
OnItemClickEventCallback<Event>This event is triggered when a menu item is clicked.dynamic item- The menu item that is toggled., string label- The label of the toggled item., dynamic value- The value of the toggled item.
ItemClickedevent MenuItemClickedEventHandlerThis event is triggered when a menu item is clicked.MenuItemClickedEventArgs
OnOpenEventCallback<Event>This event is triggered when the menu is opened. The event is fired only in "'dropDown'" "mode".N/A
Openedevent MenuOpenedEventHandlerThis event is triggered when the menu is opened. The event is fired only in "'dropDown'" "mode".MenuOpenedEventArgs
OnOpeningEventCallback<Event>This event is triggered when the menu is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in "'dropDown'" "mode".N/A
Openingevent MenuOpeningEventHandlerThis event is triggered when the menu is about to be opened. The opening operation can be canceled by calling event.preventDefault() in the event handler function. The event is fired only in "'dropDown'" "mode".MenuOpeningEventArgs
MenuCheckMode.Checkbox
MenuCheckMode.RadioButton
MenuCloseAction.Down
MenuCloseAction.Up
MenuCloseAction.None
MenuDropDownPosition.Auto
MenuDropDownPosition.TopLeft
MenuDropDownPosition.TopRight
MenuDropDownPosition.BottomLeft
MenuDropDownPosition.BottomRight
MenuDropDownPosition.OverlayLeft
MenuDropDownPosition.OverlayRight
MenuMode.Horizontal
MenuMode.Vertical
MenuMode.DropDown
MenuMode.Tree

Overflow

Overflow.Auto
Overflow.Hidden
Overflow.Scroll
MenuSelectionMode.Click
MenuSelectionMode.Mouseenter