[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:

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

How could I execute the script of loaded components?
Answers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1655
[Question] isComponent() is not invoked
I'm trying to make a plugin, but I have a problem with isComponent. My component does not call it whene the editor loading the code, this i...
Issue #906
[Question]How to change custom component content (html) from ajax?
Hi @artf, First of all thanks for this awesome plugin. Can you please let me know how i can update/change block content? I created custom b...
Issue #1272
[QUESTION] Using setComponent() ??
Creating a Plugin to use GrapesJS with Plone. GrapesJS Version: Latest When using the setComponent() function, we are scraping the HTML con...
Issue #2226
[QUESTION] Updating a component type trait definition after init
I have created a custom component & block which is used to display/embed uploaded files. I have defined traits for this component see below...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.