Issue #2764Opened May 11, 2020by lofcz0 reactions

[QUESTION] block with content -> script after loading via storageManager

Question

I have a component and a block defined inside my plugin. The block relies on fetching some data via AJAX and then re-rendering itself.

content: {
        type: "testComponent",
        content: 'AJAX loading...',
        script: function() {
           // content is changed via $("#" + this.id)
        }
    }

When I d&d block to the editor canvas all works nice. But once I load the stored data, script is not executed. It can be seen in the image that component type is saved and loaded correctly, hence the traits are there:

image

This is the same block, freshly dragged to the canvas -> it shows "AJAX loading..." at first and then JS in script is executed:

image

How could I execute the script of loaded components?

Answers (0)

No answers yet.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.