I am trying to set up a repeater to show events, but only want to show them if a Boolean value in my database named “show” is true. While I haven’t done this yet, I also want to hide events that are past the dates they are assigned. For instance, if there is an event that last between 2/4-2/6, I want the event to disappear when today’s date is 2/7. Here is my code so far:
I had read somewhere else that I might need to setup a “data” array and assign it to a repeater, but was a little confused on how to do that.
UPDATE: I got some of the elements to hide, but it wont collapse the background.
ANSWER: I had to use the collapse() function rather than the hide() function to not make the background stretch out.
#eventRepeater, is that your dataset id? cause when i do the same, and add forEachItem after my dataset, so $w(“#dataset”).forEachItem, i get an error that this doesn’t exist for this item? What am i missing
#eventRepeters is not the dataset id, but the repeater element id. I have changed my code quite a bit since this post, but am willing to look at it you will post a screenshot of your code.
got it already working. Thanks mate . but maybe you can help me with something additional things in my code.
i get the yellow attention mark. With a green line under “$w” . and the message that it is already declared in the upper scope. But when i leave it out it doesn’t work anymore?
Also, i have 3 similar export functions for 3 other buttons on there. Is there a way that i can write that routine in one function and then call upon it? No clue how you do that in wix code.
Hi there I have the same problem with Past events and I want to archive them. But they must get removed from the list of Upcoming and present events .
A little late to the party, but thought I’d share the solution for anyone coming across this topic in the future.
In most cases, you’ll want to use the .onItemReady()
when loading data for the first time.
The above examples seem to be using the .forEachItem()
which is likely why this isn’t working as expected.