Jump to content

event triggered after page load


Recommended Posts

 

https://howto.caspio.com/datapages/ajax-loading/

the above page speaks to the caspio supported addEventListeners, specifically:

  • DataPageReady 
  • BeforeFormSubmit 
  • FormSubmitted  

but DataPageReady fires when the page loads but DOES NOT wait for calculated fields/scripts to be completed.

How can I trigger code AFTER the calculated fields have completed their calculations?

 

Link to comment
Share on other sites

Hi @Elderberg

I assume you meant the calculated value in the virtual field on the form DataPage? Because the calculated field on the report DataPage should be calculated before DataPageReady event.

If we are talking about calculated value in the virtual field, you can add an event listener to this field to listen to the "change" event. When the "change" event is fired, it means that the desired calculation is completed, and you can run your script after:
 

<script>

document.querySelector('[name="cbParamVirtual1"]').addEventListener('change', e=>{

// your script goes here

})

</script>


If you have more than one virtual field, some extra coding will be required to ensure that all virtual fields have their respective calculated values ready. Could you share a link to the DataPage you are working on for more context?
 

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...