Trigger an event when Page Builder is loaded
Hello guys,
What jQuery event I can use to add some modifications to the Page Builder when editing a page?
I want to add a feature of activating and disabling rows. I managed to do that on the site, and I want to change the color of the row to something else if the row is disabled.
This should be simple and I managed to find the inactive row, but this should be done when the page is completely loaded with the page builder.
I tried to use “display_builder”, but no luck.
What jQuery event I can use in order to do this?
jQuery(function ($) {
$('.siteorigin-page-builder-widget').on('display_builder', function () {
var data = JSON.parse($('#siteorigin-panels-metabox .siteorigin-panels-data-field').val());
for(var i = 0; i < data.grids.length; i++) {
console.log(data.grids[i].style.active);
if(!data.grids[i].style.active) {
console.log($('.so-row-container').get(i));
}
}
});
});
This is our free support forum. Replies can take several days.
Need fast email support? Get SiteOrigin Premium
Replies
1Hi Vlad
Unfortunately, there isn’t an event that triggers at the moment. There are a couple things I need to change, firstly we’d need to have the main panels object globally accessible and secondly, we’d need to trigger an event after the builder view is fully rendered. When I do introduce this, it’ll be as a backbone event though, but it’s fairly easy to attach functions to these.
I’ve logged this in our issue tracker, hopefully we’ll have something in there for you soon.
Replies on this thread are closed.
Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.