9.3 - Wait for page load in a page include does not work

  • 1
  • Problem
  • Updated 2 years ago
  • Solved
I'm using this code to do some things when the page include is loaded:

(function(skuid){	
    var $ = skuid.$;
console.log("before the one");
$(document.body).one('pageload',function(){ 
console.log("loaded!");
$(".bluebg").css("background-color","blue"); //<-- silly example console.log("loaded!"); $(".redbg").css("background-color","red"); //<-- silly example });
})(skuid);
console.log("loaded! the end");

This has been working before 9.x (I went directly to 9.3) 

With 9.3 $(document.body).one('pageload',function(){  does not work anymore.

I can change it to $(function(){  and it works if the page is not in a page include, but with the page include it does not work.

The weirdest thing is:
If you go to the page directly in the console you see the both loaded, and the blue and red background applied.

If you load the page via page include, you see the 2 loaded in the console, but not the blue and red backgdround
Photo of Pablo Martinez

Pablo Martinez

  • 2,468 Points 2k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Juraj Čiljak

Juraj Čiljak

  • 60 Points
Pablo that is sad specially if you are using Tab set component :D
Photo of Stephen Sells

Stephen Sells, Official Rep

  • 16,856 Points 10k badge 2x thumb

Hi Skuid Community~

Thank you for your patience as we addressed this bug. This issue has been resolved in the Brooklyn Iteration 3 release which is now available from the Skuid Releases page.

As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission critical functionality before installing into a production environment. We also recommend that you update out of date themes when you upgrade.

Thanks!

-Skuid Support (SS)