Programmatically update page in multi-page app without refresh

Hi, I’m looking for a way to programmatically update the page in the multi-page app (as output from the callback) without refreshing the page (so I believe I cannot use dcc.Location). I hope there is a way to do this?
I’m trying to enable the full-screen spinner in the shared layout of the multi-page app before changing page, using links causes the layout to be re-rendered first to the new page and only then the spinner enabling callback is called.

HI @kiteme,

what is the reason for the update if you don’t want to “refresh” it? What exactly do you want to update?

I only want to update the page displayed in dash.page_container, not refresh (reload) the whole page. Similarly like navigating using dcc.Link - it only refreshes the page inside the container. But as described, I need the intermediate step so I can display the full screen spinner

Hello @kiteme,

You can add a full-page spinner and just tell it when and when not to display.

Check out this post:

I’m already using dash loading spinners and I’m just removing and setting the content of a div to enable or disable the spinner. Your suggestion looks better - but how can I call the javascript command to enable or disable spinner from within the python callback?

You’d add listeners to whatever event you want to show the loading page in the JS side.

@jinnyzor would you mind posting a small example of how to use this? I’ve looked at the samples online a couple of times but I still can’t figure out how exactly to put it together. I have zero knowledge of js… thanks!