Issue #2764○ OpenOpened May 11, 2020by lofcz0 reactions

Block with content -> script after loading via storageManager

待解决问题

No community answers yet. Open the original discussion on GitHub to share your solution.

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...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins →
Premium option

Premium plugins ship with support, regular updates, and production-ready features — save days of integration work.

Browse premium plugins →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.