Antony
January 7, 2020, 9:49am
1
My app is very large, and before setting off on the journey of creation, I want to find the optimal way of working.
I have many areas of my design I need to toggle the visibility of, and I would prefer not to have to declare a variable for each one.
So for example, if I want to change the visibility of my form (id=f_edit_contact), then I would like to be able to say on clickable items:
dmx-on:click="f_edit_contact.hide()"
and
dmx-on:click="f_edit_contact.show()"
I can already do this on a modal, but I can’t seem to make it work on anything else.
Is this possible, or do I have to go down the “declaring lots of variables” route?
Best wishes,
Antony.
Teodor
January 7, 2020, 9:55am
2
Hello Antony,
The show/hide dynamic events you mention are specific for the modal component. The different component have different specific dedicated events.
You can show/hide any component by using the show and hide dynamic attributes.
Antony
January 7, 2020, 9:57am
3
Hi @Teodor … thanks for your always rapid reply!
So am I correct in saying that I will have to declare variables to show/hide other components than modals?
Teodor
January 7, 2020, 9:59am
4
Well, it depends on when/how you want to hide… it must be a dynamic value, where does it come from and what is it depends on your specific case.
It can be a variable, a database query value, a server connect status etc.
Antony
January 7, 2020, 10:00am
5
Yes, good point, it can be much more than just a variable!
I will think about my use case.
Thank you!
1 Like