Show container box in repeater if text field is true

Seeming to have an issue with this code not showing the container box when there is text in the linked field.

Can’t figure out what I’m missing or doing wrong.

Any help most welcome.
Ty kindly

$w . onReady ( function () {
$w ( “#repeater2” ). onItemReady ( ( $w , itemData ) => {
console . log ( itemData . eventUpdate );
if ( itemData . eventUpdate === true ) {
$w ( “#EventUpdateBox” ). show (); }
});
});

For starters, you have 2 $w.onReady, while you should only have 1. Get rid of the one around the repeater.onItemReady. Then show us full code.

Hi @giri-zano , appreciate the reply and time to help.

I’m no coding master at all. So this is probably ugly and clunky, but till now has worked for what I’ve needed it for.

import wixData from ‘wix-data’ ;

$w . onReady (() => {
datefilter ();
$w ( ‘#repeater2’ ). onItemReady (( $wInRepeater , itemData ) => {
const thereIsNoUrl = ! itemData . url
if ( thereIsNoUrl ) $wInRepeater ( ‘#booknowbutton’ ). collapse ()
})
});

//EVENT UPDATE BUTTON------------------------------------------------
$w ( “#repeater2” ). onItemReady ( ( $w , itemData ) => {
console . log ( itemData . eventUpdate );
if ( itemData . eventUpdate === true ) {
$w ( “#EventUpdateBox” ). show (); }
});
//-------------------------------------------------------------------

$w . onReady ( function () {
$w ( “#repeater2” ). onItemReady ( ( $w , itemData ) => {
console . log ( itemData . specialEvent );
if ( itemData . specialEvent === true ) {
$w ( “#specialeventicon” ). show (); }
});
});

function datefilter () {
var d = new Date ();
$w ( “#dataset1” ). setFilter ( wixData . filter ()
. ge ( “datetime” , d )
);
}

$w . onReady ( function () {
$w ( “#eventDetailsButton” ). target = “_self” ;
});

Oh boy, that is not going to work. Could you do me a favor and just write, point by point, in plain English, what you want to achieve and what data the collection holds?
Second, read this: https://www.wix.com/velo/reference/$w/repeater/introduction
and pay attention the the “scope”. Also note the difference in your repeater params and those used on that page ($w vs. $item).

Then I can help you further. It needs a complete overhaul, but first, you need to read up a bit. Ok?

Hey Giri, lol…yes…it’s ugly. I’m no coder and have really only just pulled my limited knowledge together to get everything up until this latest hurdle working.

In plain english, and simply:

  • I want a container box (EventUpdateBox) in the repeater to show only if there is text in the field (eventUpdate) of the database.

Unless you mean what I want all the code to achieve?

I’ll do some reading on that link you included now. Trying to avoid a complete re-write of the code but if that’s what it’s going to take so be it and I’ll get an expert in to clean it all up for me.

Thanks again for your help on this.
L

Don’t worry, it’s not that much to rewrite, I’ll help you. But instead of giving it to you, I would like you to understand what the problem is, then we will solve it.