I have a multipage Dash WebApp that consists of following pages:
app.py
<=from where app is launchedsql.py
<=different functions/queries/variables/lists pulling data from SQL- 'page1.py` <=contains a layout for the page, incl. AG Grid
columnDefs_1.py
<=contains column definitions for the AG Grid onpage1.py
and a lista
fromsql.py
- 'page2.py` <=contains a layout for the page, incl. AG Grid
columnDefs_2.py
<=contains column definitions for the AG Grid onpage2.py
and a listb
fromsql.py
On page1.py
and page2.py
inside the layout I have the following line, thanks to which the layout is refreshed/activated once a week or when page (app) is refreshed in browser.
dcc.Interval(id='interval_pg1', interval=86400000*7, n_intervals=0),
The problem is that when I physically refresh the webapp in the browser, only page1.py
and page2.py
are refreshed, i.e. only layouts are refreshed.
The columnDefs_1.py
and columnDefs_2.py
files are not refreshed, thus, they are not pulling the latest lists from SQL, thus, layout on page1.py
and page2.py
doesn’t contain latest lists (e.g. dropdown options are not updated).
How do I force columnDefs_1.py
and columnDefs_2.py
to refresh each time I refresh pages in the browser?
I know I could avoid it if I put all columnDefs inside page1.py
and page2.py
, but I am trying to do it in a “cleaner” way.
Thanks for help in advance.