Hello
I try to make a accordion,I get data from the base and I want to place them on the accordio dynamic,every element that comes from the bottom I put it under the other as one works one ListView.
when I use clear_widgets () it only shows me the new element that I get from the base
when I do not use it makes them dynamic but ιt shows me on a brown screen all
and it adds to me the last element since I call the function logically
I do not know if I use the widget well
Thanks
an example I want to use a dynamic accordion
kv:
BoxLayout:
orientation: 'vertical'
id: all_orders
size_hint_x: 0.9
size_hint_y: None
height: self.parent.height/1.4
pos_hint: {'x': .05 , 'y': .1}
Accordion:
orientation: 'vertical'
id:item_orders
min_space: 30
python:
AccordionItem:
id: acc_id
title: '$acc_title'
width : 640
min_space: 20
#BoxLayout:
# id:items
Label:
text: '$acc_content'
''')
numrec = len(self.items_all)
for product in self.items_all:
acc_title = 'order'
acc_content = ','.join([product['product_name'] for product in self.items_all])
new_acc = self.tpitem.substitute(vars())
acc = Builder.load_string(new_acc)
self.item_orders.add_widget(acc)