You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a project using the ABP Framework with a Blazor front end, and I’ve encountered a challenge that I’m hoping you might be able to assist me with.
I am trying to update the main menu items dynamically, but unfortunately, the changes are not being rendered as expected.
I injected IMenuManager into my blazor page and use the following code to update my menu (Test submenu items in my case).
var mainMenu = await MenuManager.GetMainMenuAsync();
var testMenu = mainMenu.FindMenuItem("Test");
// Clear the existing menu items
testMenu.Items.Clear();
// Add the new menu items
foreach (var item in MyItems)
{
testMenu.AddItem(
new ApplicationMenuItem(
$"Test.{item.Name}",
item.Name,
url: $"/test/{item.Id}"
)
);
}
When I call the above method, the main menu does not reflect the updates. I suspect that I need to invoke StateHasChanged() on the ABP menu module (component), but I’m unsure how to access it.
I’ve searched through the ABP documentation and community forums, but I haven’t been able to find a solution to this issue.
Is there any workaround for this?
Thanks.
The text was updated successfully, but these errors were encountered:
I am currently working on a project using the ABP Framework with a Blazor front end, and I’ve encountered a challenge that I’m hoping you might be able to assist me with.
I am trying to update the main menu items dynamically, but unfortunately, the changes are not being rendered as expected.
I injected IMenuManager into my blazor page and use the following code to update my menu (Test submenu items in my case).
When I call the above method, the main menu does not reflect the updates. I suspect that I need to invoke StateHasChanged() on the ABP menu module (component), but I’m unsure how to access it.
I’ve searched through the ABP documentation and community forums, but I haven’t been able to find a solution to this issue.
Is there any workaround for this?
Thanks.
The text was updated successfully, but these errors were encountered: