Does Experience Builder emit events on page change?

12-06-2022 08:59 AM
New Contributor
I have a charting library that doesn't work with multiple pages in an Experience Builder application. Our layout has a header at the top with links to the different pages in our experience. When we initially load the experience, we load up the home page, and the chart widget displays fine. However, if I then navigate to another page in the experience that also has (another instance of) the chart widget, then navigate back to the home page, the original instance is gone. The place in the overall layout is there, but it's just a blank div.
My team and I think the best way to solve this problem is to use the charting library's destroy() method and then reinitialize the chart, on page switch. I'm looking for events firing on page switch, but other than "load," I'm not seeing any in my dev tools. (And "load" won't work for us because it only runs the first time, and does not fire again when I navigate back to the original page.) Does Experience Builder have any sort of events I can listen to for when a user navigates between pages? If not events, is there any other way that Experience Builder announces it's switching pages, and is there a way to hook into that?
0 Kudos
0 Replies