-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
It seems that only the table events in the initialy visible tab are triggered:
from nicegui import ui
from nicegui_tabulator import tabulator
tabledata = [
{
"id": 1,
"name": "Oli Bob",
"age": "12",
},
{
"id": 2,
"name": "Mary May",
"age": "1",
},
{
"id": 3,
"name": "Christine Lobowski",
"age": "42",
},
]
table_config = {
"height": 205,
"data": tabledata,
"layout": "fitColumns",
"rowHeader": {
"formatter": "rowSelection",
"titleFormatter": "rowSelection",
},
"columns": [
{
"title": "Name",
"field": "name",
},
{
"title": "Age",
"field": "age",
},
],
}
with ui.tabs().classes("w-full") as tabs:
tab1 = ui.tab("Tab1")
tab2 = ui.tab("Tab2")
tab3 = ui.tab("Tab3")
with ui.tab_panels(tabs, value=tab1, keep_alive=True).classes("w-4/5 h-full"):
with ui.tab_panel(tab1).classes("w-full h-full"):
table1 = tabulator(table_config).on_event(
"rowClick",
lambda e: ui.notify(f"Row clicked: {e}"),
)
with ui.tab_panel(tab2).classes("w-full h-full"):
table2 = tabulator(table_config).on_event(
"rowClick",
lambda e: ui.notify(f"Row clicked: {e}"),
)
with ui.tab_panel(tab3).classes("w-full h-full"):
table3 = tabulator(table_config).on_event(
"rowClick",
lambda e: ui.notify(f"Row clicked: {e}"),
)
ui.run()
Metadata
Metadata
Assignees
Labels
No labels