I have 2 repeaters with the same columns containing a username and a checkbox.
Each repeater has unique usernames. What I am trying to accomplish is if a checkbox is checked in one row of a repeater, if the same username exists in the other repeater the associated checkbox will be disabled, and only become enabled if the checkbox in the first repeater is unchecked. That interaction would happen between both of them - if a check box is selected in one repeater, I want the checkbox with corresponding username to become disabled in the other. I plan on each row having about 5 checkboxes with the same dependency.
It looks like on the CB-B, CBState is being set to “off” when the checkbox is Selected. If you change that to “on”, then checking Adam in RepeaterB disables Adam in RepeaterA.
For this to work both ways and across many rows, it seems like it would need a lot of variables. You may consider another column that keeps track of “disabled”. Haven’t completely thought through how that would be built, but could be worth a shot.
Thanks for the response, Victor. I fixed that and now I have an issue with persistence, which is why I believe you mentioned keeping track of the disabled state as opposed to current behavior where it will only disable one checkbox at a time and then re-enables on a different checkbox in RepeaterB.
More frustratingly trying to get RepeaterA to interact with ReapeaterB. I think because the update is in the Item Loaded call.
I might try an attempt to just manipulate the repeater table. I have a attached sample that I thought would work but for some reason just does not want to work.
When you are marking the rows in RepeaterB from the checkbox in RepeaterA you can use TargetItem instead of Item to check the value in RepeaterB. I changed that on Page 1 and that helped.
The checking of the checkbox and refreshing the repeater to check the checkboxes was getting confusing for me so on Page 2, I made a change in RepeaterA to use a dummy widget (could be a transparent rectangle over the checkbox) that handles the clicking and only changes repeater data (and not directly setting the checkbox state until the repeater loads again). Just an idea.
This is such a helpful tip for managing complex repeater logic. Using TargetItem is definitely the way to go here to avoid the headache of syncing global variables. Glad to see the working file was posted as well, it's a great reference for others dealing with similar dependency issues.