Figured it out, I basically had to clear out the morph panel first with self.update_morphs_panel.clear() to get rid of the old stuff
I’ve taken David’s lozenge box a bit further: I styled it a bit and added a couple of different Multi-Select dropdowns (one allows multiple selections of a given option, the other constrains each option to be selected once).
https://anvil.works/ide#clone:HHODAZZUU3RKOHCT=4WBA6XT6ZH3O7G5H624COD5W
7 Likes
This looks great and you beat me to it lol I’ve been trying to make things look prettier now in my app definitely gonna use this
Hi Guys,
Thanks a lot for this topic.It helped me a lot.
I managed to create similar functionality (see image).
Additionally, I created a list from component objects that will be inserted into data table.:
def remove_1(self,**params):
params['sender'].remove_from_parent()
print [x.text for x in self.flow_panel_1.get_components()]
def addcoffee_variety_drop_down_change(self, **event_args):
"""This method is called when an item is selected"""
btn = Button(font_size=8)
btn.icon = 'fa:trash'
btn.text = self.addcoffee_variety_drop_down.selected_value
self.flow_panel_1.add_component(btn)
btn.set_event_handler('click',self.remove_1)
return [x.text for x in self.flow_panel_1.get_components()]
2 Likes