Hi there, I have a list of yoga classes displayed on a screen.
I wanna add days of the month as buttons to the screen above the list, and when the user taps on any day of the month, the list will filter accordingly.
How do I trigger an action to refresh the list based on the day the user taps on?
Here’s a sample video of what I’m trying to achieve:
If there’s any better way to achieve this, please share.
Hey @Bryony, I’m populating the initial list using a data variable.
I actually managed to figure it out
I needed to set a page variable “day” and bind the button to the page variable. Every time a user taps on any given day, the page variable will change.
The list of classes below is also bound to the page variable, so when the “day” changes, the list also changes.
Only issue is that every time I tap on the day, it takes about 5 seconds for the page to refresh.
Not sure if it’s something I can control, but the latency is ridiculously long. Maybe it’s got to do with a built-in delay of 5 seconds or something before the data on the same screen refreshes?
If you just change that ‘Delay 5000 ms’ to what you prefer. Personally I don’t use this because I find it’s high-load on my APIs so I just trigger a manual refresh of my page variables when I need to but yeah, you should be able to reduce the latency this way. Hope this helps!
If you move your refresh logic to the page canvas, you can add a Receive event node with name like “Refresh data” and trigger it via the Trigger event node! (There’s a bug that prevents custom events from being triggered on the data variable logic canvas, so you need to do the logic on the page logic canvas, or the global canvas.)