Issue #581💬 AnsweredOpened November 28, 2017by ppisecky1 reactions

Reading component related events

Quick answerby ppisecky1

@artf hey thanks for your answer. I was however looking for a more general example of determining if changes happened and what they were - for example something like this: We need to track changes to components in a project so we need something more general. Could you also possibly explain why so many component:update...

Read full answer below ↓

Question

The Editor API wiki lists a set of component-related events that can be listened to (e.g. component:add, component:update). There is however no mention of what sort of event objects the listener receives and how they are structured (what properties do they have and what values can they contain.) When a component gets updated (for example its font-size is changed) we need to be able to catch the event, process it and react to it. Can you give us an example of how to determine what sort of changes occured on the component? Do changes happen every time the component:update event is fired (this e...

Answers (3)

ppiseckyNovember 30, 2017

@artf hey thanks for your answer. I was however looking for a more general example of determining if changes happened and what they were - for example something like this: We need to track changes to components in a project so we need something more general. Could you also possibly explain why so m...

artfNovember 30, 2017

Thanks @ppisecky for pointing this out, I updated the source, but basiclly any component-related event just receives the triggered model. About your font-size case, you can set up this listener

lock[bot]September 18, 2019

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.

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.