x

how to capture update settings event of the external settings inside the editor_element.js

Let's says inside my external settings URL 

I send my data to my Weebly app

 

if(message.action === "settings:load"){
           
            const settings = {
                action: "settings:update",
                data: {
                    question: "my new question"
                }

            }
        
           parent.postMessage(settings, window.frameOrigin);
}

Now how to capture the event that the question attribute has been updated from that external setting inside editor_element.js

 

 

I tried 

this.settings.on("change:question", function(model, name) {
                console.log("question change")
              
})

And the only way I found to make it works is to set it inside my editor_element.js file which doesn't resolve my issue

this.settings.set("question", "John Doe");

I want to be able to set settings from my external URL file and capture change inside my editor_element.js 

747 Views
Message 1 of 3
Report
1 Best Answer

Best Answer
I think there was probably a bug in my development site, I tried it on a different site and it works.

View Best Answer >

721 Views
Message 2 of 3
Report
2 REPLIES 2

Best Answer
I think there was probably a bug in my development site, I tried it on a different site and it works.
722 Views
Message 2 of 3
Report
Square

Thanks for letting us know! Smiley Happy 

709 Views
Message 3 of 3
Report