I have a repeater with a button included.
I would like the button to act as both a COUNTER and open the corrisponding TITLE page.
But I can only get it to do one or the other.
I have coding for the counter that works perfectly but then the link to the title dynamic page it stops working on wont open up the link.
Coding for the counter:
// // // // // // // Download counter // // // // // // // //
export function button1_click(event) {
const data = $w("#repeater1").data; ///<- put here the repeater id insted of 'repeater1'
let answersitem = data.find(item => item._id === event.context.itemId);
if (!answersitem.downloadCounter) { // the default value is null , you need to check if null ->
answersitem.downloadCounter = 1;
} else {
answersitem.downloadCounter++; // increment field by 1
}
wixData.update("BookletVolumes", answersitem).then(() => {
$w("#dataset1").refresh();
});
}
*Also is there a way to change the code above to a “button counter” own its own as the one above is part of a repeater (this would be for a seperate page that has no repeater)
Any help is massively appreciated,
Dean
