Skip to content
Discussion options

You must be logged in to vote

The content of the JSON editor isn't bound to the dictionary. Therefore you need to call update() to update the UI:

nicedict = {'a': 1, 'b': 2}

def updatenicedict():
    nicedict['a'] = nicedict['a'] + 1
    editor.update()

ui.label().bind_text_from(nicedict, 'a', backward=lambda a: f'a: {a}')
ui.button('increase', on_click=lambda: updatenicedict())
editor = ui.json_editor({'content': {'json': nicedict}})

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@falkoschindler
Comment options

Comment options

You must be logged in to vote
1 reply
@GeorgiT-HI
Comment options

Answer selected by GeorgiT-HI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants