Hi everyone,
I am looking for the simpliest way to collapse or expand an element on a dynamic page, depending on a boolean in the database.
In my collection, I have 2 restaurants. One use a specific delivery service, and the other one don’t. So I have two columns in the database with boolean, where it is checked when needed or unchecked.
The collection I need to access is called “Services”
The columns names are : “Delivery”, and “Nodelivery”
The elements names are : “DeliveryBox” and “NodeliveryBox”
I am looking for something like this, but can’t find a way to write it the proper way
import wixData from 'wix-data';
$w.onReady(function () {
wixData.query("Services")
let Delivery = Delivery.value;
if(Delivery === "true"){
$w("#DeliveryBox").expand();
}
else{
$w("#DeliveryBox").collapse();
}
});
Any help would be very appreciated
Thanks