Filter - show/hide row in rptr2 based on selection from rptr1

advanced-prototyping
repeater-widget

#1

i have a scenario where I want to hide (then possibly show) a row in repeater 2 (rptr2) based on a selected row in repeater 1 (rptr1} using a checkbox.

Both repeaters have the same columns and data. If I click a checkbox for a row in rptr1, I want to hide the similar row in rptr2. I have this part working, but now I need to reverse the hide of the row in rptr2
by unchecking the checkbox from rptr1. If I select more rows from rptr1 then similar rows hide in rptr2. As I said I have this part working.

Now I am finding the only way to show the hidden row in rptr2 is by removing the filter. This unfortunately removes all filters. I want a remove all, in case there is a desire to revert all filtering, but more importantly I need to be able to show the single row or rows i have hidden initially. Certain situations may require just to show the similar hidden row or rows from rptr1 and not to just remove all filters to show all columns again.

Does anyone have a suggestion?

I am attaching a test file I have been using to get this working.
show-hide_row-filters.rp (73.3 KB)


#2

Hi!

Rather that set a filter per item you’re hiding, create just one filter on repeater 2 that filters based on the values in one of its columns, then update that column.

  • Add a column to repeater 2 called ‘is_hidden’ and add a filter to repeater 2 that shows rows only when that column value is false. (You can just leave this column blank initially, because blank will evaluate as false.)
  • On select/unselect of the checkbox in repeater 1, update the corresponding row in repeater row, setting its is_hidden column to true or false, accordingly…

I’m attaching the updated file. Note that initially all of the values in the is_hidden value are blank. You can set these to false initially if you want to, but blank evaluates as false, so leaving it that way is fine.

The filter is created on Loaded of the repeater (not on Item Loaded). Filters stay active once they are created, so if at any time you change the value in the is_hidden column, the filter will be re-applied.

Preview

show-hide_row-filters.rp (75.4 KB)


#3

Thanks ever so much Joseph!! Again, you are brilliant and I don’t know why I did not think of this.
Kudos!!


closed #4

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.