Is there the best method to dynamic load options for ui.select? #2328
italanchan
started this conversation in
General
Replies: 1 comment
-
Interesting problem. Maybe something similar to this from nicegui import ui, events
@ui.page('/')
def index():
def handle_typing(e: events.GenericEventArguments):
nonlocal query
query += e.args['data']
selection.options = [f'{query} {i}' for i in range(10)]
selection.update()
def handle_blur():
nonlocal query
query = ''
query = ''
selection = ui.select(options=[], with_input=True,
on_change=lambda: ui.notify(selection.value)) \
.on('input', handle_typing).on('blur', handle_blur)
ui.run() In |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Our case is provide the customer lists for ui.select (over 1M records),
Is there the best method to dynamic load options for ui.select?
Beta Was this translation helpful? Give feedback.
All reactions