I am trying to make a button displayed inside a popup react dynamically to a parent thing from a repeating group (it will make sense - I promise!)
For an Events app I’m making, I want it to be possible for users to register interest in an event.(Registering event attendance/interest) - how to setup?)
In the front end, event details display in a pop up from a Repeating Group of Events (Things).
(please forgive the placeholder images - I used whatever was at hand)
The data displayed in the popup is mostly dynamic - e.g. the images, text, etc. all have the option to use the parent group as the data source.
I have an ‘INTERESTED’ button displayed in this popup. I want this button, when clicked, to enter that parent event in a list of events interested for the user. However, the button isn’t connected to the parent event, it just floats independent inside the popup. eg:
How can I link this to the parent event?
In theory, it should be something like, when Button ‘Interested’ is clicked and parent event is not included in Current users Favorite Events, add event (and change button text to ‘registered’ or something). And the inverse… If Button is clicked and parent event is found in current users favourite events then remove it, etc.
But when loaded how do I make the button in this popup recognise the state of the parent event!
Any help much appreciated. I have been playing with this for a while and can’t seem to figure it out!