I have used the following method to integrate tables in a dash application with tabs:
@HansG Thanks for reporting! I see what’s going on here.
A little context: When Dash serves the page, it crawls the app.layout to see which component libraries are being used (e.g. dash_core_components). Then, with this list of unique component libraries, it serves the necessary JS and CSS bundles that are distributed with those component libraries.
In this case, we’re serving dash_table_experiments on a separate page, as the response of a callback. Dash only sees dash_html_components and dash_core_components in the app.layout and so it doesn’t serve the necessary JS and CSS bundles that are required for the dash-table-components component that is rendered in the future.
This is a design flaw of Dash. For now, you can get around this issue by rendering a hidden dash-table-experiments component in the layout like:
When loading the app, my table and the data inside it appear properly, however, when navigating through the tabs, and getting back in the tab where my table is, the data has disappear, and I need to click on one of the inputs for the data to appear again.
I have actually found the issue, but can’t really solve it.
I have 5 tabs on my app. The table is in the first tab. Which is the default value tab in my html.Div([dcc.Tabs])
I have tested putting the tabs value as an input, and what I have noticed, is that when getting back in my first tab, it doesn’t recognized that I am on the first tab. I need to click twice on the tab for it to understand.
@mishd - Are you facing the same issue that was reported above or is your issue different? If it is a different issue, could you try creating a simple, reproducable example and updating your dash versions? Some of these issues have been fixed in recent dash releases.
Hi @chriddyp, Yes, I am facing the same issue. so I have multiple tabs generating multiple tables and the moment I moved one tab to another tab and then moved back to the same tab it juts disappears. I have user persistent on dash.DataTable but seems not working.