Hello! I’m trying to collapse a button inside of an $item of a repeater if a field of the itemData matches a specific value.
unfortunately, collapse or hide the button for every element of the repeater and not just for the one with the specified field.
I’ve already tried this solution: https://www.wix.com/velo/forum/community-discussion/hide-repeater-contents-based-on-data?origin=auto_suggest
but it didn’t work even if my case is pretty similar to this one, my code is the following:
export function Repeater_itemReady($item, itemData, index) {
let i=0
$item("#Img").src = itemData.src
//console.log(i++)
if (itemData._id === "selectedField"){ $item("#button").expand(); console.log('selectedField'); $item("#button").label='selectedField'}
else {$item("#button").expand() ; console.log(i++,'otherfield')}
}
The funny thing is that the label changes and console.log shows everything(also the ‘selectedField’ one) but only the button doesn’t expand/collapse.
Thanks