I have a textbox where I can enter a text to search if it exists in the database and if so display the result(s) in the Datagrid repeating panel. It is working correctly.
I want that if I enter a text that it checks if the text can be found in the database (so far ok)
- but if no result, check the same entered text.capitalize()
- if still no result, check the same entered text. upper()
- if still no result, check the same entered text. lower()
Therefore how can I check that the result is none?
Can I find the number of repeating panel items of the search result?
server-side code
@anvil.server.callable
def search_comp(query):
result = app_tables.component.search(tables.order_by(âKTnrâ, ascending=True))
if query:
result = [
x for x in result
if query in x[âKTnrâ]
or query in x[âMftnrâ]
or query in x[âMftâ]
or query in x[âDescriptionâ]
or query in x[âPlaceâ]
]
return result
client-code example:
def search(self, **event_args):
captext = self.txtbox_search.text
self.repeating_panel_1.items = anvil.server.call(âsearch_compâ,captext)