I have a multipage Dash WebApp that consists of following pages:
app.py<=from where app is launched
sql.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 on
page1.pyand a list
- 'page2.py` <=contains a layout for the page, incl. AG Grid
columnDefs_2.py<=contains column definitions for the AG Grid on
page2.pyand a list
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
page2.py are refreshed, i.e. only layouts are refreshed.
columnDefs_2.py files are not refreshed, thus, they are not pulling the latest lists from SQL, thus, layout on
page2.py doesn’t contain latest lists (e.g. dropdown options are not updated).
How do I force
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
page2.py, but I am trying to do it in a “cleaner” way.
Thanks for help in advance.