Completed
Last Updated: 13 Dec 2023 08:03 by ADMIN
Release 5.1.0 (31 Jan 2024) (R1 2024)
Expose an OnItemRender event, which is raised for each menu item. The args will allow setting a Class, that will be applied at the topmost element of the item iteself, allowing full customization, as well as PopupClass, which is applied to the topmost element of the item popup.
Completed
Last Updated: 21 Aug 2023 12:05 by ADMIN
Release 4.5.0 (08/30/2023) (R3 PI2)
Created by: Eli
Comments: 6
Category: Menu
Type: Feature Request
68
If you are on a 3rd level child menu and move the mouse to a 2nd level parent menu item that is not the direct parent, the menu hides. It should keep the first level open. Is there a way to control the opening and the closing of the submenu items?
Completed
Last Updated: 26 Jul 2022 17:14 by ADMIN

Dear,

 

the blazor menu UI adapt it self for hamburguer menu when mobile?

best,

 

Jeff

---

ADMIN EDIT

I have attached to this post a sample implementation that you can use as base. Another option is to add more conditional markup to remove the menu altogether and replace it with another structure for small screens. A third option is to use the Drawer component as it collapses anyway (see here and here).

----

Completed
Last Updated: 18 Feb 2022 20:58 by ADMIN
Release 3.1.0
Created by: Alberto
Comments: 5
Category: Menu
Type: Feature Request
33

At the moment, when you click a menu item it does not hide.

A method can be exposed to hide the expanded items that can be invoked from the OnClick handler.

---

ADMIN EDIT

Here is a potential workaround - when the menu item is clicked, we use a little bit of JS to go over the menu items at the root and make the browser think that the user moved the mouse away from them which is the signal for the menu dropdowns to hide. Do test this carefully before using in production, though.

@inject IJSRuntime _js

@* Move this script together with other scripts in the project, it is here to make the snippet shorter *@
<script suppress-error="BL9992">
    function closeMenu() {
        setTimeout(function () {
            var mouseLeaveEvent = new Event('mouseleave');
            var rootNodes = document.querySelectorAll("li.k-menu-item");
            rootNodes.forEach(function (elem) { elem.dispatchEvent(mouseLeaveEvent); })
        }, 30);
    }
</script>

<TelerikMenu Data="@MenuItems"
                ItemsField="@nameof(MenuItem.SubSectionList)"
                TextField="@nameof(MenuItem.Section)"
                UrlField="@nameof(MenuItem.Page)"
                OnClick="@((MenuItem item) => OnClickHandler(item))">
</TelerikMenu>

@code {
    public List<MenuItem> MenuItems { get; set; }

    async Task OnClickHandler(MenuItem item)
    {
        await _js.InvokeVoidAsync("closeMenu");
    }



    public class MenuItem
    {
        public string Section { get; set; }
        public string Page { get; set; }
        public List<MenuItem> SubSectionList { get; set; }
    }

    protected override void OnInitialized()
    {
        MenuItems = new List<MenuItem>()
                {

            new MenuItem()
            {
                Section = "fetchdata",
                Page = "fetchdata"

            },
            new MenuItem()
            {
                Section = "counter",
                Page = "counter"
            },

// sample URLs for SPA navigation
new MenuItem()
{
    Section = "Company",
    SubSectionList = new List<MenuItem>()
                        {
        new MenuItem()
        {
            Section = "Overview",
            Page = "fetchdata"
        },
        new MenuItem()
        {
            Section = "Events",
            Page = "fetchdata"
        },
        new MenuItem()
        {
            Section = "Careers",
            Page = "counter"
        }
    }
},
// sample URLs for external navigation
new MenuItem()
{
    Section = "Services",
    SubSectionList = new List<MenuItem>()
                        {
        new MenuItem()
        {
            Section = "Consulting",
            Page = "counter"
        },
        new MenuItem()
        {
            Section = "Education",
            Page = "fetchdata"
        }
    }
},
new MenuItem()
{
    Section = "Contact",
    Page = "counter"
}
};

        base.OnInitialized();
    }
}

---

Completed
Last Updated: 10 Jul 2020 07:03 by ADMIN
Release 2.16.0
Created by: Jaco
Comments: 1
Category: Menu
Type: Feature Request
3
I don't see any examples with a menu item separator.  Is there a way to create a menu item separator?