What I’m trying to do:
Removing elements from token box with code. There is no documentation regarding the remove() command except … I read the explanation in the docs and the remove button is triggered by clicking a button – but is there a way to iterate over the buttons looking for a text match and then triggering the remove?
Thank you. – JM
What I’ve tried and what’s not working:
Code Sample:
# row_count is just a text box in the repeating panel functioning as ID for row
for x in self.repeating_panel.items:
if x['row_count'] == row:
# token_box is a list of words in the token box prior to being added to the
# token box another , this is added during the population of repeating
# panel - with no corresponding component .. it works.
for i,y in enumerate(x['token_box']):
c = self.token_box_1.flow_panel_1.get_components()
print(f"c {c}") #showing the list of buttons
print(c[i].text) #button name appears
c[i].remove_from_parent() #removes that button --
## todo match button name with desired button to delete or run through all to ## delete all
# this is a formatted code snippet.
# paste your code between ```
Clone link:
share a copy of your app