Question: Dynamic Changes vanish when load from DB
Question
@artf
Here is my code , I am adding test in a div on select change
init() {
this.listenTo(this, "change:noOfLinks", this.getInfoLinks);
},
getInfoLinks() {
let canvasDoc = editor.Canvas.getDocument();
canvasDoc.getElementById("infoLinks").innerHTML = " test text ";
editor.trigger("change:selectedComponent");
editor.TraitManager.getTraitsViewer().render();
},
You can see script is working fine and "test text" is displaying

When I press save button. It saves in DB and when I refresh editor, it loads data but the changes "test text" is not there

Please help what I am missing in the code. ThanksAnswers (0)
No answers yet.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3413
QUESTION: Adding inline scripts and updating old events
In that case, I suggest you access the document of the iframe and to append manually the inline script (to get the document use editor.Canv...
Issue #2667
link element not append in head element in ediot.canvas #firefox #grapesjs
am trying to add google fonts in web-builder to change the font style for that to import am adding cdn in editor the code works in chrome a...
Issue #1526
[QUESTION] how to make fullscreen command
Hi, unfortunately I do not find documentation and can't manage to get it understand from code: I know there is a built-in command 'fullscre...
Issue #1511
[QUESTION] Change the html content of the selected component
I am trying to replace the html of the basic Text componet using the below code const component = editor.getSelected(); component.set('cont...
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.