Files
radzen-blazor/Radzen.Blazor/PanelMenuRenderMode.cs
Vladimir Enchev 284d6db3dc PanelMenu: add Server RenderMode to render collapsed branches on demand
Adds PanelMenuRenderMode (Client default, Server) so large menus can keep the
DOM small by rendering child items only while their parent is expanded.

- RadzenPanelMenu.RenderMode parameter; child content gated on expanded in Server mode.
- Keyboard expand decisions (Enter/Space, ArrowRight) key off ChildContent instead of
  rendered items.Count so collapsed branches expand in Server mode.
- Fix focus/selection loss on collapse: RadzenPanelMenuItem.Dispose now routes nested
  items to ParentItem.RemoveItem (matching AddItem) instead of Parent.RemoveItem, which
  reset focusedIndex/currentItems.
- Keep the expand arrow visible for expandable items with no rendered children in Server
  mode via the rz-navigation-item-expandable class.
2026-07-02 08:35:09 +03:00

18 lines
636 B
C#

namespace Radzen;
/// <summary>
/// Specifies the ways a <see cref="Radzen.Blazor.RadzenPanelMenu" /> component renders the child items of its expandable items.
/// </summary>
public enum PanelMenuRenderMode
{
/// <summary>
/// All child items are rendered up front and collapsed ones are hidden. This preserves the expand/collapse animation but keeps the entire menu in the DOM.
/// </summary>
Client,
/// <summary>
/// Child items are rendered by Blazor only while their parent item is expanded. Collapsed branches are not rendered, which keeps the DOM small for large menus.
/// </summary>
Server
}