Send Marked Repeater rows to another repeater on Button press

repeater-widget

#1

Hi - I’ve been struggling with sending selected rows to another repeater only when clicking a button outside the repeater. I thought this was going to be easy. I can sort of get what I am after using a filter but it doesn’t scale. So my requirement is:

  1. Select items to accept or reject
  2. Click a button to set accepted or rejected to the marked rows.
  3. (If the rows marked are accepted) - Send these rows to repeater 2.
  4. If the row marked Accepted in repeater 1 is then changed to Rejected, remove that row in Repeater 2

The additional requirement is to calculate the total of the Cost column in Repater 2 (and show this in an external Total Accepted Costs) widget. I’m struggling with removing the Cost from the total when removing rows. My maths are going all over the place.

In this file, I have to check the row > mark it as accepted, then check the row again to send it to Rptr2.
Multi-Marked Rows.rp (94.1 KB)

I thought this would have been so easy, yet it’s proving to be a real headache. If someone can help, I’d be so grateful.

Thanks in advance.


#2

Getting repeater data out of a repeater and into something else can be tricky. Here’s how I’d do it:

  • Use an event that you’re not otherwise going to use (e.g., “moved”) on some widget inside your first repeater (e.g., the checkbox) to handle the evaluation and transformation of its row’s data:

    • check to see if its row’s State value is “accepted”
    • copy its row’s data to the second repeater
    • delete its own row from the first repeater
  • Fire that event when your user clicks “send accepted”.
    The advantage here is that you don’t need to deal with filters or the TargetItem syntax, which can be pretty mind-bendy.

Here’s this method applied to your file (note, I didn’t quite understand how you want the “sum” text box to behave, and I’ve likely broken it, so be sure to have a look at that):

Multi-Marked Rows.rp (92.4 KB)


#3

Thank you Ishillman. Really appreciate your time and help. I had got a version working where I just send the row over, have a filter on the RPTR2 and. update Data in both rows when I click Accept.

This move listener approach seems much more versatile.

Thanks


closed #4

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