Bindable link target? #5518
Closed
masterjg
started this conversation in
Ideas / Feature Requests
Replies: 3 comments 4 replies
-
|
Hi @masterjg, At the moment there is no bindable link = ui.link('Link')
binding.bind_to(app.storage.user, 'auth.url', link.props, 'href')
ui.button('Change URL', on_click=lambda: app.storage.user.update({'auth.url': 'https://www.google.com'}))or simply update the URL in a change event handler: link = ui.link('Link')
@app.storage.user.on_change
def on_change():
link.props.update(href=app.storage.user.get('auth.url', ''))
ui.button('Change URL', on_click=lambda: app.storage.user.update({'auth.url': 'https://www.google.com'})) |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
ah! |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
P.s> maybe it would be good idea to expose generic binding method in each element |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Not sure what is the easiest way to bind link target?
this is what I have. But since
auth.urlvalue is set async later time than content is rendered it never changes until I reload web. Surely there should be something likeui.link().bind_from("target", app.store.user, "auth.url")right? like bindable attributes that are not only text, value, visibility?Beta Was this translation helpful? Give feedback.
All reactions