Is it possible to hide repeater items based on current item value?
I am displaying the same repeater twice, but depending on an instance I want to hide certain items based on a
type
field inside each row. Is it possible?Solution:Jump to solution
this would only hide inner elements and leave the empty container afaik. I've managed to do this with custom classes for the container and some css magic
6 Replies
Yes? visible(fn($get) => $get('type') === 'my_type)
it's running even when repeater is empty, are you sure it is accessing the individual repeater rows?
It’s a closure so it will be evaluated on runtime.
Using visible on the individual columns will mean it runs on each records column data.
I don't use eloquent, it's a repeater traversing an array inside a form. Each row of repeater has
type
field.Correct in in the repeater there is a column i.e. select, textinput the visible is applied to this.
Solution
this would only hide inner elements and leave the empty container afaik. I've managed to do this with custom classes for the container and some css magic