Elderberg Posted May 12, 2021 Report Share Posted May 12, 2021 I have the below in the footer of a Pivot Report Drill down. The code runs once upon the first drill down, but when i return to the Pivot and drill down again into another area, the code executes twice, repeating again and it executes 3 time, then 4 times etc, etc. Looking for help on understanding why i'm observing this behaviour.. and how to prevent it. <script> document.addEventListener('DataPageReady', function(event) { alert("hello"); }); </script> Quote Link to comment Share on other sites More sharing options...
TellMeWhy Posted May 13, 2021 Report Share Posted May 13, 2021 Use something like event.stopImmediatePropagation(); or event.stopPropagation(); Just put that inside. If it does not work, try the Example 2 in https://howto.caspio.com/datapages/ajax-loading/ and restrict it with the DataPage's AppKey, and put the event.stopImmediatePropagation(); or event.stopPropagation(); inside that Quote Link to comment Share on other sites More sharing options...
Volomeister Posted June 22, 2022 Report Share Posted June 22, 2022 Hi Elderberg, You could do next: const mainF = ()=> { alert("hello"); document.removeEventListener('DataPageReady', mainF) } document.removeEventListener('DataPageReady', mainF) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.