Skip to main content
Nintex Community Menu Bar
Question

For an inline javascript item - how do you run the javascript each time the lightning component is r

  • July 11, 2024
  • 2 replies
  • 8 views

Forum|alt.badge.img+10

Hello!

For an inline javascript snippet I’ve typically used this to run the snippet:

$(document.body).one('pageload',function(){<br>&nbsp; &nbsp; SOME CODE<br>}


However, this will only run the first time the component is rendered if the Skuid Page is embedded in a lightning component. If you navigate to a different page and then back to the previous page (importantly - this is internal navigation where a full page refresh doesn’t take place - e.g. navigating to a different page in a Salesforce Community) - then this inline javascript will not be re-executed.

So, in a nutshell - I need a way for the inline javascript to be executed each time the Skuid page in the lightning component is rendered.

Cheers!

Louis


This topic has been closed for replies.

2 replies

Forum|alt.badge.img+1

Hi Louis,

An Event Triggered Action Sequence which uses the event of **Skuid Page: Rendered ** should work. This is then a declarative way to call actions on Skuid Page load. Screenshot below for reference, this is calling two Adopt Row actions.

Cheers,
Matt


Forum|alt.badge.img+10

Amazing! I’ve tested this and it works perfectly - it’s exactly what I was looking for. My inline javascript is now instead a snippet which is executed each time the Skuid page is rendered. Ace!