A way to view all active bindings? #4230
Unanswered
flintcreek
asked this question in
Q&A
Replies: 2 comments 2 replies
-
You can access active bindings using from nicegui import ui, binding
bind = {1: 'a', 2: 'b', 3: 'c'}
options = [1, 2, 3]
ui.select(options=options, value=1).bind_value(bind, 1).classes('w-24')
ui.radio(options=options, value=2).bind_value(bind, 2).props('inline')
ui.slider(value=3, min=1, max=3).bind_value(bind, 3).classes('w-24')
for b in binding.active_links:
print(b)
ui.run() |
Beta Was this translation helpful? Give feedback.
0 replies
-
Simon- Thank you, I guess I could have dug deeper before asking since that now seems so obvious.
I do wonder if bindings to and from storage are polled in the active links loop? They show up in the list. Is there a way to make those BindableProperty objects?
…-Matt
On Jan 15, 2025, at 9:34 PM, Simon Robinson ***@***.***> wrote:
You can access active bindings using binding.active_links, here's a basic example:
from nicegui import ui, binding
bind = {1: 'a', 2: 'b', 3: 'c'}
options = [1, 2, 3]
ui.select(options=options, value=1).bind_value(bind, 1).classes('w-24')
ui.radio(options=options, value=2).bind_value(bind, 2).props('inline')
ui.slider(value=3, min=1, max=3).bind_value(bind, 3).classes('w-24')
for b in binding.active_links:
print(b)
ui.run()
—
Reply to this email directly, view it on GitHub<#4230 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARO5CWOWVPFNBRQMQAPHJUL2K4SDHAVCNFSM6AAAAABVICCNPCVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCOBVGAYTGOA>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Question
Is there a way to inspect the list of all active bindings in a nicegui app? I'm getting the "binding propagation" message, and it would be helpful to see all the active bindings so I can begin optimizing.
Beta Was this translation helpful? Give feedback.
All reactions