How to change properties of a single row in a repeating panel?

I am trying to build an app on the side to be used for packing orders.

I have a repeating panel that includes the list of items in the order for a user to pack. Right now I have a button that you can click and will change the row colour to indicate that it has been picked.

def button_pick_click(self, **event_args):
  self.flow_panel_1.background = 'theme:Primary 700'
  self.button_unpick.visible = 1
  self.button_pick.visible = 0

This works fine and here is the design view to get a basic idea.

image
the screenshot above is a nested repeating row as some items are assemblies so it shows the components, but functionally its the same as the top repeating row.

But now I am looking to extend this to use a barcode scanner. So I want to create a text field that on change will search through the rows in the repeating and if it finds a matching barcode, it will change only that row colour.

I know I can set the properties of a repeating panel using self.repeating_panel.background = 'theme:Primary 700' but this changes all the rwos… so how would I go about changing only the single row if it finds a match?

Any help, or pointers will be greatly apprecaited!

I cant share the app as it is pulling data from our warehouse management software via API.

1 Like

Here is an example that hopefully will get you started.

The example shows that you can press a button on a parent form and this will raise an event on all children in a repeating panel.

Now, of course you will need to extent this example, but in general, from what I can understand, the concept is the same. In your case you would have a text box somewhere, and its change event would raise events on all children panels, changing background color where needed.

I hope this helps point you in the right direction.

I should also mention that you can also loop through repeating panel components with self.repeating_panel_1.get_components(). This would allow you to set up some logic as you iterate through each child.

4 Likes

Thanks @alcampopiano managed to figure it out using that example app you sent using raise_event_on_children()

1 Like

Great work!

Can you explain how you figured it out. I’m trying to do the same thing