Page Load Snippets stopped working- Brooklyn

All of our page load snippets don’t appear to work in Brooklyn. I’ve got a simple example where I expect to see a console log message, and I get nothing.

Example snippet:
(function(skuid){ var $ = skuid.$;
$(document.body).one(‘pageload’,function(){

console.log(“Page load snippet is running”);
});
})(skuid);

Page XML:















{{Name}}


{{Model.label}}



































(function(skuid){
var $ = skuid.$;
$(document.body).one(‘pageload’,function(){

console.log(“Page load snippet is running”);
});
})(skuid);





Chandra,

What iteration of Brooklyn are you on?

I just installed this morning, so 9.3.1

Org ID and access provided to Skuid support team via email.

Hi Chandra V ,

Is this Issue fixed? As we’re also facing same Issue.

regards,
Chandra A.

Chandra is out today but issue is not resolved.

Thank you Daniel.

We have been searching for work arounds until skuid Team can fix it. 

One work around for now is using "$(document).ready(function(){"  instead of "$(document.body).one('pageload',function(){" in Inline snippet. We are still testing all our scenarios.


 Hope this may help !!


regard's,

Chandra A


One warning: using $(document).ready() instead of triggering on the first pageload won’t work for page includes. It is only triggered once on initial page load, so any included pages that need to run inline javascript when they’re loaded will continue to fail.

The code we have in a page where it is not working was as follows:

(function(skuid){

                var $ = skuid.$;

                $(document.body).one(‘pageload’,function(){

                                //var myModel = skuid.model.getModel(‘MyModelId’);

                                //var myComponent = skuid.component.getById(‘MyComponentUniqueId’);

                               

                                skuid.snippet.getSnippet(‘ClearUserFields’)();

                                console.log(‘page load snippet has run’);

                });

})(skuid);

 

When we replace:

$(document.body).one(‘pageload’,function(){

 With :

 $(window).on(‘load’,function(){

 

It works fine. Honestly don’t understand what that statement means but it runs on page load. Another user within our company was using this code successfully.

Hope this helps.



Hi All,

Just wanted to let you know that our developers are currently working on this, and the fix is targeted to be out in the next release. Thanks for your patience, and for sharing your workarounds with each other!

Hi All,

This issue is now fixed in Brooklyn Iteration 3, available from our 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!
Amy