Hi all,
Currently working on a new page that uses a repeater with a number of elements, including checkboxes/sliders, text and a button which when clicked will reset the item to show the original state ie checkboxes/sliders reset to FALSE/0 respectively. Whilst in design stage I currently have 2 items in the repeater and at the moment I have got to the point where the button on item 1 resets just item 1 but then when clicking on the button on item 2, it resets both items instead of just resetting item 2.
The code I have reached is below:
export function button12_click(event, $w) {
$w('#repeater1').onItemReady(($w, itemData, $item) => {
let currentItem = $w('#dataset1').getCurrentItem();
console.log(currentItem)
$w('#checkbox1').enable();
$w('#checkbox1').checked = false;
$w('#checkbox2').checked = false;
$w('#slider1').enable();
$w('#slider1').value = 0;
$w('#slider2').value = 0;
$w('#text562').hide();
$w('#text563').hide();
$w('#text560').show();
});
}
Having read up on numerous pages on here as well as the API, I've tried different alternatives but not manager to get any further forward so thought I'd turn to you guys to see if anyone could kindly point me in the right direction please?
Thanks
$w.onReady(()=>{ $w('#repeater1').onItemReady(($item, itemData, index)=> { $item('#checkbox1, #slider1').enable(); $item('#checkbox1, #checkbox2').checked = false; $item('#slider1, #slider2').value = 0; $item('#text562, #text563').hide(); $item('#text560').show(); }); });
Everything --> INSIDE --> REPEATER --> $item
Everything --> OUTSIDE --> REPEATER --> $w