How to disable tab_panel in nicegui? #3985
-
QuestionHow to disable tab_panel in nicegui? from nicegui import ui
condition = False
with ui.tabs().classes('tabs-container') as tabs:
ui.tab("Run Program").classes('run-tab')
ui.tab("Create Program").classes('create-tab')
with ui.tab_panels(tabs, value="Run Program").classes("programs_panel") as panels:
with ui.tab_panel("Run Program") as run_panel:
# Check if the program_names list is empty
if not condition:
# Disable the "Run Program" according to condition boolean flag
run_panel.style("q-tab-panel: disable")
ui.run() |
Beta Was this translation helpful? Give feedback.
Answered by
falkoschindler
Nov 12, 2024
Replies: 1 comment
-
You can call run_panel.disable() |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
belalhmedan90
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can call