How to use Quasar's q-pull-to-refresh component in NiceGUI #3628
-
QuestionIs it possible to use the Quasar q-pull-to-refresh component in NiceGUI? I am able to get it on the page and it calls my discover function when pulled. The issue is that I don't see how to retrieve the "done" parameter that the refresh event is supposed to pass to the handler. def discover(event):
print(event) # <-- I hoped the "done" parameter from Quasar was in "event" somewhere, but I don't see it.
with ui.element('q-pull-to-refresh').on('refresh', discover):
ui.label('content to refresh') |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hi @flintcreek, The problem with the But we can handle the event directly in JavaScript, emit a custom event to Python, and call with ui.element('q-pull-to-refresh').on('refresh', js_handler='(done) => { emitEvent("refresh"); done(); }'):
label = ui.label('content to refresh')
ui.on('refresh', lambda: label.set_text('refreshed')) The only downside is that |
Beta Was this translation helpful? Give feedback.
Here is a more advanced version that actually waits for the refresh to complete: