I got a repeating panel self.display_data which takes the employee punches from above (refer to picture) and puts it into a data table with all of the employee’s clock in/out.
What I am trying to do is when the button “End Shift” is clicked, the repeating panel should update to the new data table which has the employee data inside it.
So my question is how do you update the repeating panel to show the information? If I log out and log back, the data table reflects the last punch.
I tried something like this and vice versa, but I don’t understand it.
def end_shift_click(self, **event_args):
clockout_end_shift = self.Current_Time()
clock = self.Start_back_from_lunch.text
current_user_row = anvil.users.get_user()
current_user = current_user_row['email']
for row in app_tables.clockinoutsystem.search(q.all_of(Users=current_user,Clock_In=clock)):
row['Clock_Out_End'] = clockout_end_shift
self.end_of_shift.text = clockout_end_shift
total_hours = self.total_hours()
total_hours = self.TH.text
for row in app_tables.clockinoutsystem.search(q.all_of(Users=current_user,Clock_Out_End=clockout_end_shift)):
row['Hours_worked'] = total_hours
# refreshing the time card view
self.item = self.displaying_data.items
return
Clone link:
share a copy of your app