Sidebar toggle

is there a way when the page loads to have the sidebar hidden until the toggle is clicked ?

This is doable by following these steps:

  1. Exclude the main layout from code generation. Go to the application settings page (... item in the top right corner of Radzen) and type client\src\app\main-layout in the Code generation ignore list textbox. Click Save.
  2. Open the client\src\app\main-layout\main-layout.component.html with your favourite text editor program. Set the open property of the Angular component to false:

<rz-sidebar #sidebar0 [open]="false">

1 Like

That worked great. Thanks!

I've tried to put a condition in there but I failed.
Could I make this behaviour dependent on the users role?
<rz-sidebar #sidebar0 [open]="security?.user?.roles?.indexOf('role.manager.admin') == 1">

@Moo, this should work. What's the actual result of this? Also why not use the built-in isInRole method? This will check that the target role is precisely at index 1 which may not always be the case.

I will try that (both), thank your for the fast answer :slight_smile:
Now that I'm looking at it ... your're right the check itself doesn't look good.