[RadzenPanelMenuItem] Selected state based on pattern #275

Closed
opened 2026-01-29 17:34:36 +00:00 by claunia · 2 comments
Owner

Originally created by @MPapst on GitHub (Dec 5, 2021).

Is your feature request related to a problem? Please describe.
Building a Menu on a Application that offers "types" on the menu and details navigation not on the menu (e.g. having Customers as menu point, but navigating to a Customer with Id n in the url) skips the selected state of the menu item when in a sub state.

Describe the solution you'd like
Introduce a PathMatch Property that takes an enum:

  • Full default
  • Beginning
  • Contains (not sure about the use of this)
  • End (not sure about the use of this)
  • Pattern uses a second new property PathPattern with a regex pattern
    Based on the PathMatch Property the Selected of the item is calculated using the Path and the current Uri.

Describe alternatives you've considered
Setting the selected state on base of the path using a pattern or similar works but is a lot of effort.

Additional context
Please let me know if this would work for you and I will prepare a Pull Request with implementation.

Originally created by @MPapst on GitHub (Dec 5, 2021). **Is your feature request related to a problem? Please describe.** Building a Menu on a Application that offers "types" on the menu and details navigation not on the menu (e.g. having Customers as menu point, but navigating to a Customer with Id `n` in the url) skips the selected state of the menu item when in a sub state. **Describe the solution you'd like** Introduce a `PathMatch` Property that takes an enum: * Full `default` * Beginning * Contains (not sure about the use of this) * End (not sure about the use of this) * Pattern uses a second new property `PathPattern` with a regex pattern Based on the `PathMatch` Property the `Selected` of the item is calculated using the Path and the current Uri. **Describe alternatives you've considered** Setting the selected state on base of the path using a pattern or similar works but is a lot of effort. **Additional context** Please let me know if this would work for you and I will prepare a Pull Request with implementation.
Author
Owner

@akorchev commented on GitHub (Dec 6, 2021):

We should better emulate the existing behavior of NavLink.

@akorchev commented on GitHub (Dec 6, 2021): We should better emulate the existing behavior of [NavLink](https://github.com/dotnet/aspnetcore/blob/main/src/Components/Web/src/Routing/NavLink.cs#L111-L130).
Author
Owner

@akorchev commented on GitHub (Dec 24, 2021):

Implemented the NavLink behavior in 73a3a881ca

@akorchev commented on GitHub (Dec 24, 2021): Implemented the NavLink behavior in https://github.com/radzenhq/radzen-blazor/commit/73a3a881caec5f30f7b84916853ca7c91fc8d097
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#275