Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

NavigationProvider and JS hookup #775


User avatar
0
paulbackhouse created

I have created my menus and all working fine.

In Layout.js abp.nav.menus.MainMenu contains the menu as described.

However, I have some customDataand order requirements. I set some values for order against each MenuItemDefinition object and on one item has set customData.

BUT, abp.nav.menus.MainMenu is no reflecting these new properties at all. They don't come through via the API at all.

My question is why not? I have literally added these properties in the definition but they are not brought through as properties in the JS object.

Example:

.AddItem(
                    new MenuItemDefinition(
                        "Settings",
                        new LocalizableString("Settings", imanageConsts.LocalizationSourceName),
                        url: "/settings/#/",
                        icon: "fa fa-cogs",
                        order: 7,
                        customData: new Dictionary<string, object>() {{ "someKey", new string[] { "soemValue1", "someValue2", "someValue3" } }}
                        )
                );

3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    It's strange. I checked the code and it serializes your custom data while creating the script (see code here: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/blob/109c9ffdb4f1ac8a2d71bac5819ae534a8625f56/src/Abp.Web/Web/Navigation/NavigationScriptManager.cs#L111">https://github.com/aspnetboilerplate/as ... er.cs#L111</a>).

    Be sure that javascripts are not cached in your browser (disable caching always).

  • User Avatar
    0
    paulbackhouse created

    just seen this reply. I browse in incognito mode - they just don't serialise through

  • User Avatar
    0
    hikalkan created
    Support Team

    OK, if you are sure about that, can you create an issue on Github: <a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate/issues/new">https://github.com/aspnetboilerplate/as ... issues/new</a>