Issue #3239✓ SolvedOpened January 18, 2021by harsh2015 reactions

How to update attribute/properties dynamically from Component Script?

Quick answerby artf4

You don't need components with JS in this case (in your final code you don't execute any JS), is enough for you something like this:

Read full answer below ↓

Question

We have a use case where we want to insert charts dynamically using Highcharts Editor. I have created a component, which on drag and drop, opens a modal based and based on user's selection, returns a SVG image. I am wondering how can I add it to the model's body. Right now I am using innerHTML to insert but the getHTML does not have the SVG image as part of div. Code for component: Also I want to set the JS output of highcharts editor as attribute to the div(or, is there a way, I can add it to component but not render it, but be able to retrieve it by getHTML), is there a way I can dynamicall...

Answers (4)

👍 Most helpfulartfFebruary 3, 2021

You don't need components with JS in this case (in your final code you don't execute any JS), is enough for you something like this:

harsh201January 20, 2021

@artf Any help here will be appreciated. I went through the docs again and nothing stands out, which I could be missing.

GJSBlockMay 17, 2026

Thanks for reporting this, @harsh201. Great question about [Question] How to update attribute/properties dynamically from Component Script?. The recommended approach with Components is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on...

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.