If you don't want to use JS / CSS, you can simply use conditional visibility on your data view that's based on an attribute (boolean). Make the buttons toggle the boolean to its opposite value and your data view will hide / unhide itself.
Alternatively, if you just want users to be able to hide / unhide the view and it doesn't really matter how, you could consider a group box. That allows users to collapse everything inside the group box.
My app security is in production mode, and right now I am hiding based on selected roles. Is it possible to use conditional visibility for both selected roles and hiding the current dataview?
My buttons are 2 separate buttons, so I am not sure which method suits me. I do not mind learning both ways ( JS/CSS) and conditional visibility from scratch, if it is ok.