Skip to content

how to update dropdown Selection options dynamically ? #324

Closed Answered by falkoschindler
morningstarsabrina asked this question in Q&A
Discussion options

You must be logged in to vote

As mentioned here, you can simply manipulate the options of a ui.select and call update afterwards:

select = ui.select(['A', 'B', 'C'])

def add_option():
    select.options.append('D')
    select.update()

ui.button('Add option', on_click=add_option)

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@morningstarsabrina
Comment options

@falkoschindler
Comment options

@falkoschindler
Comment options

@morningstarsabrina
Comment options

Answer selected by morningstarsabrina
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #322 on January 31, 2023 17:53.