Toggling the sidebar from a button?

Toggling the sidebar from a button?

  

I'm trying to create a button that toggles my right sidebar open.

I've implemented the sidebar interaction in my mobile application. (On the right side of screen)

I set the IsOpen property to a variable called "SidebarOpen"

I have a button, onclick it runs a client action which assigns the SidebarOpen variable to True.

On the first click, the button works and opens the sidebar.

Once I slide the sidebar closed with touch, and tap (click) the button again, it will not open the sidebar.

I tried assigning the SidebarOpen variable to false and then assigning it to True again. This did not work either.

Any ideas?

Solution

Hi Levi


On the button that opens the sidebar try negating it, instead of assigning it to true (so SidebarVariable = not SidebarVariable). That should solve your problem. 


Regards

  CLSJ

Solution

Carlos López Santibáñez Jácome wrote:

Hi Levi


On the button that opens the sidebar try negating it, instead of assigning it to true (so SidebarVariable = not SidebarVariable). That should solve your problem. 


Regards

  CLSJ

Worked like a charm, thanks again!