Editor.setComponents(html) reset to default traits values on editor
@krunal039 editor.getHtml() it's your FINAL output and obviously, there are no pieces of information about traits and other stuff. Store and use editor.getComponents() then, if you need the user to edit templates again.
Read full answer below βQuestion
#522 thanks for all help was able to resolve via this.model.attributes. but now I have another issue, where editor.setComponents reset value in editor of html retrived to default traits values. Application flow 1) User redirected to grapesjs editor to edit page content, where they can use different components 2) On save editor.getHtml() saved to database and redirect user to page and new content will be retrived from db and displayed with selected component and values 3) User can choose to edit same page and redirected to editor page 4) On load page components retrieved from db and loaded on...
Answers (2)
@krunal039 editor.getHtml() it's your FINAL output and obviously, there are no pieces of information about traits and other stuff. Store and use editor.getComponents() then, if you need the user to edit templates again.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1092
[BUG]traits and storage trigger
Hey, maybe it's not bug, i'm not sure. I have traits with changeProp: true field. When I change the value of trait by UI, model is changed...
Issue #771
Image src is not updating
Hi @artf, I have updated the image src using below code: editor.getSelected().set('attributes', {'src': image_Url}); but when i set all the...
Issue #841
[QUESTION] Add default Trait (attribute) to model for all HTML Components (elements)
Hi, I've read the Traits, Components and API wikis, grepped all the open & closed issues. I've even found the code where you are creating t...
Issue #912
[BUG]: HTML attributes/traits not escaped
When double quotes are added to an attribute it breaks the HTML.https://jsfiddle.net/szLp8h4n/Drag in the link block.Click the link in the...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.