Need help to fix an issue that is somehow bothersome. Have a repeater that shows events from a dataset, but the Participants # comes from another table and is the count of rsvp using the eventID.
The issue is that there is a delay of around 2 seconds to show the number. All the other values shows on page load since they are connected to the data.
In my code I have a dataset ready function that when the dataset triggers that is ready it then goes an updates the value.
I guess I have to put something on the $w . onReady (() => { }, but I don’t know what to do.
Please help me. Thanks.
export function dataset1_ready ( ) {
// console.log(“Updating Repeater on dataset ready”);
if ( $w ( “#dataset1” ). getTotalCount () > 0 ) {
$w ( “#repeater1” ). forEachItem ( ( $item , itemData , index ) => {
wixData . query ( “EventRSVP” )
. eq ( “eventID” , eventid )
. count ()
. then ( ( mynum ) => {
let numberOfItems = mynum ;
$item ( “#numRSVP” ). text = " " + numberOfItems ;
if ( numberOfItems >= numMaxPlayers )
{
$item ( “#btnJoin” ). hide ();
$item ( “#txtMessage” ). show ();
}
} );
}