I have an issue. In preview, for one item, when I click on "reserveButton", the item "group1" appears. This is what I want. But when I publish my website and click on "reserveButton" the "group1" doesn't appear. Did I write something wrong? Thanks for your help.
import wixData from 'wix-data'; import wixLocation from 'wix-location'; $w.onReady(function() { $w('#title1').show(); $w('#description').show(); $w('#group1').hide(); $w('#thanks').hide(); $w('#repeater2').onItemReady(($item, itemData) => {
if (itemData.isReserved === true) { $item('#reserveButton').hide(); $item('#alreadyReserved').show(); } else { $item('#reserveButton').show(); $item('#alreadyReserved').hide(); $item('#reserveButton').onClick(event => { $item('#reserveButton').hide(); $item('#group1').show(); }); } }); });
I also tried by using this function, but "group1" of every items appears :(.
export function reserveButton_click(event) { $w('#repeater2').onItemReady(($item) => { $item('#group1').show(); $item('#reserveButton').hide(); }); }
Since #group1 is not in the Repeater, but rather on the page itself, you should use $w for #group1, like this:
$item('#reserveButton').onClick(event => { $item('#reserveButton').hide(); $w('#group1').show(); });
Your SANDBOX-DB and LIVE-DB is synced? (Identical DATABASES?)