I want to hide buttons on repater that has no value, how to do it ?
This is my current code that is not working, what i miss here ?
repeater.forEachItem(($item, itemData, index) => {
if ($item((‘Button’)+index).link === ‘’){
$item((‘Button’)+index).hide();
} else {
$item((‘Button’)+index).show();
}
That looks super wierd:
($item((‘Button’)+index)
You do not need to use the “Index”-Value.
Try this:
repeater.forEachItem(($item, itemData, index) => {
if ($item(('Button').link){
$item(('Button')).hide();
}else {
$item(('Button')).show();
}
Shouldn´t that be:
repeater.forEachItem(($item, itemData, index) => {
if ($item(('Button').link){
$item(('Button')).show();
}else {
$item(('Button')).hide();
}
Ay. You are right.
If the Link exist then show the button, else not.