I’m trying to build a dropdown filter. I have four dropdowns.
Behind each dropdown is a table columns that contains the options. Each table has one column so far, set to text. I got this code from the forum to connect the columns with the drop down:
def regionDrop_show(self, **event_args):
"""This method is called when the DropDown is shown on the screen"""
self.regionDrop.items = [row['region'] for row in app_tables.region.search()]
self.regionDrop.selected_value
def subjectDrop_show(self, **event_args):
"""This method is called when the DropDown is shown on the screen"""
self.subjectDrop.items = [row['name'] for row in app_tables.subject.search()]
self.subjectDrop.selected_value
def schoolDrop_show(self, **event_args):
"""This method is called when the DropDown is shown on the screen"""
self.schoolDrop.items = [row['type'] for row in app_tables.schooltype.search()]
self.schoolDrop.selected_value
def ageDrop_show(self, **event_args):
"""This method is called when the DropDown is shown on the screen"""
self.ageDrop.items = [row['agelevel'] for row in app_tables.age.search()]
self.ageDrop.selected_value
It throws a TypeError saying: items must be a list of strings or tuples. But not when I run the paragraphs individually, especially without the ageDrop, everything seems to work just fine.
I am a beginner at all this, but willing to learn! So if you have any hint, I will educate myself.