General editor updates using editor.on('update') event
Hello. You can declare variables for html, css and js and their value is going to get updated every time when editor change event is triggered. change() { this.html = editor.getHtml(); this.css = editor.getCss(); this.js = editor.getJs(); } editor.on('change', t...
Read full answer below ↓Question
Hi! Is there a way to get general, last editor updates using editor.on('update') event? Something like this: editor.on('update', e => { // get the event // get the specific, recent updates (HTML and CSS) })
Answers (2)
Hello. You can declare variables for html, css and js and their value is going to get updated every time when editor change event is triggered.
change() {
this.html = editor.getHtml();
this.css = editor.getCss();
this.js = editor.getJs();
}
editor.on('change', this.change);
I've found another available event, editor.on('change'), but it seems difficult to read the HTML and CSS updates from this event
Related Questions and Answers
Continue research with similar issue discussions.
Issue #1066
[QUESTION] Get content with inline CSS
I've been looking for some explanation and I found that some email clients blocks CSS... I would like to know if is there some way to get e...
Issue #2404
Question: how to observe children changes in component
Is there an easy way to subscribe/listen to changes in the components/children of my custom component type? Perhaps an event I can subscrib...
Issue #3600
[Question]: Event listener to visibility(eye) icon in the Layer Manager
I would like to listen to the eye icon in the layer manager from the editor, based on which, I need to write the custom styles. Is there an...
Issue #3506
FEAT: add click event on blocks
Or Is there any way to listen for click event in block ?
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.