Can new items be dynamically inserted into an existing ui.menu? #4250
-
QuestionI understand how to dynamically append items to an existing menu, but how can new item(s) be inserted at a specific position in the menu (not at the end)? |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Jan 21, 2025
Replies: 1 comment 1 reply
-
Hi @flintcreek, You can with ui.column() as container:
ui.label('first')
ui.label('second').move(container, target_index=0) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
flintcreek
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi @flintcreek,
You can
move()
new elements after you created them. This way you can specify the target container element as well as the target index: