Issue #720💬 AnsweredOpened January 5, 2018by krunal0390 reactions

Document Dirty Indicator

Quick answerby artf

Tried this in the demo and works as expected

Read full answer below ↓

Question

I want to display document dirty indicator unless document is saved to database. I have custom button on editor to save html to db I tried below #551 but it only fires while loading html from db to canvas and it does not fire for any changes afterward.

editor.on('change:changesCount', () => { const editorModel = editor.getModel(); const changes = editorModel.get('changesCount'); if (changes) { //show dirty count }

Answers (3)

artfJanuary 5, 2018

Tried this in the demo and works as expected

editor.on('change:changesCount', (model) => { 
	console.log('changed'); 
});
austinbiggsJanuary 5, 2018

@artf - I tried this in my code an nothing happens. This works for you?

I'm running v. 12.58 😄

artfJanuary 8, 2018

This works for you?

Yeah, it works with the demo (which uses the latest version)

I tried this in my code an nothing happens

Have you tried to change the structure of the template?

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.