In the above repeater, there are two buttons “Cancel” and “Return/Refund”.
At first only Cancel button will be shown and Return/Refund button will be hidden.
But when the refund-button is set to true in the dataset, the Cancel button should be hidden and Return/Refund button should be shown of that particular list.
Any idea on how to achieve this?
$w(“#repeater1”).forEachItem(($item, itemData, index) => {
let productname = itemData.productName;
let orderid = itemData.title;
let size = itemData.size;
let color = itemData.color;
wixData.query(“AdminOrders”).eq(“title”, orderid)
.and(wixData.query(“AdminOrders”).eq(“productName”,productname))
.and(wixData.query(“AdminOrders”).eq(“size”, size))
.and(wixData.query(“AdminOrders”).eq(“color”, color))
.find()
.then( (results2) => {
let refundbutton = results2.items[0].refundButton;
if (results2.items[0].refundButton){
$w(‘#button6’).show();
$w(‘#button5’).hide();
}
})
})
This code do not work