Hide and Show Left Navigation on Icon Click

 In my previous post, we have created the UI for the component. If you haven't seen it, please check it first before moving on here. 

In this post, we will be learning how the gallery should hide and show when user clicks on the hamburger icon.

Steps:

1. Click on the component 'compLeftNavBar' under Tree View and then under `Properties`, click `New custom property'.
2. Type 'OpenMenu' and set the data type to `Boolean`, and check the option "Raise OnReset when value changes" and press Create. (check at the end of this post to learn more about Raise OnReset)
3. Select `OpenMenu` property on top and set its value to `false` (without quotes). If you can't see it, try refreshing your browser tab after saving your work.
4. Similary, select `OnReset` property of the component and set the value to `Set(showMenu, compLeftNavBar.OpenMenu)`.
5. Now click on the hamburger icon and edit  value for `OnSelect` property to `Set(showMenu, !showMenu)`.
6. Similarly, click on the Gallery and edit value for `Visible` property to `showMenu` (without quotes).

Now, test your component using the Alt key.





Explanations:
1. Raise OnReset:
  • The OnReset property is an event that triggers when a control is reset using the `Reset` function.
  • We would set the OnReset property of a control to a formula that defines what should happen when the control resets.

Comments

Popular

How To Create MySQL Table with SequelizeJS

How To Read CSV Files in Java as Maven Project

How To Create A Hibernate Project in Maven