We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Setting id from sub menu item throwing error in browser console on selecting item

Thread ID:

Created:

Updated:

Platform:

Replies:

151025 Jan 28,2020 03:10 PM UTC Jan 29,2020 04:53 PM UTC Blazor 1
loading
Tags: Menu Bar
Admir Hodžic
Asked On January 28, 2020 03:10 PM UTC

With version 17.4.44 looks like there is BUG in menu.

In earlier versions of  Blazor components this worked for me

<EjsMenu CssClass="dock-menu" Orientation="@Verorientation" Items="@MainMenuItems">
                                <MenuEvents   ItemSelected="MenuSelect"></MenuEvents>
                            </EjsMenu>


@code {

    public Orientation Orientation = Orientation.Horizontal;
    public Orientation Verorientation = Orientation.Vertical;

public List<MenuItem> MainMenuItems = new List<MenuItem>{

        new MenuItem {
            Text = "Meni izbornik (Klikni da se sakrije)", IconCss = "fas fa-bars", Id="0" 
        },

        new MenuItem {
            Text = "Početna straica", IconCss = "fas fa-home", Id="1"
        },
        new MenuItem  {
            Text="Test", IconCss="icon-comment-inv-alt2 icon" ,Items =new List<MenuItem>(){
                 new MenuItem { Text="Counter sample", IconCss="icon-comment-inv-alt2 icon" , Id="2" },
                 new MenuItem { Text="Fetc sample", IconCss="icon-comment-inv-alt2 icon" , Id="3" },
            }
        },

};
  private void MenuSelect(Syncfusion.EJ2.Blazor.Navigations.MenuEventArgs args)
    {
        var menuId = args.Item.Id;
        if (menuId == "0")
            this.sidebar.Toggle();

        if (menuId == "1")
            NavigationManager.NavigateTo("/");

         if (menuId == "2")
            NavigationManager.NavigateTo("/fetchdata");

         if (menuId == "3")
            NavigationManager.NavigateTo("/counter");
}

Clicking on sub menu item which has property Id  throws error in browser console

constants.js:93 Uncaught DOMException: Failed to execute 'querySelector' on 'Element': '#2' is not a valid selector.
    at e.<anonymous> (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2504448)
    at e.notify (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:483325)
    at t.e.trigger (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:502097)
    at t.closeMenu (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2503781)
    at t.clickHandler (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2520161)


constants.js:93 Uncaught DOMException: Failed to execute 'querySelector' on 'Element': '#2' is not a valid selector.
    at e.<anonymous> (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2504448)
    at e.notify (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:483325)
    at t.e.trigger (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:502097)
    at t.closeMenu (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2503781)
    at t.clickHandler (https://cdn.syncfusion.com/ej2/17.4.44/dist/ej2.min.js:10:2520161)
(anonymous) @ constants.js:93
e.notify @ constants.js:93
e.trigger @ constants.js:93
t.closeMenu @ constants.js:93
t.clickHandler @ constants.js:93



Arunkumar Devendiran [Syncfusion]
Replied On January 29, 2020 04:53 PM UTC

Hi Admir, 
 
Sorry for the inconvenience caused. 
 
We have checked your reported issue and we are able to reproduce it in our end. We have logged this as a defect “Setting id as number on sub menu item throwing error in our end. We will include the fix for this issue in our upcoming patch release (Feb 5, 2020) and appreciate your patience until then. Please follow the below feedback link, 
  
Feedback Link: 
 
Regards, 
Arunkumar D 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon