Issue #553💬 AnsweredOpened November 21, 2017by baxxos2 reactions

Adding new components to existing ones

Quick answerby ryandeba1

Unfortunately I am not aware of a simple way to get a specific component object without recursively iterating through them to find the one you want, but that sounds like a great idea! You might be able to do something like this to get all components and then filter for the one that you want (this code is not fully tes...

Read full answer below ↓

Question

Hello, I would like to ask if there's any existing support or API for adding new components to an existing component list (e. g. after fetching or generating them dynamically). I'm talking about something like this: I've studied the documentation and the closest I got is the function. Unfortunately, this function specifies no target where the new component should be placed. I'm asking this because my intention is to use GrapesJS in a real-time collaborative way and sending the whole HTML representation back and forth after every user action is just too slow. Best regards, Michal

Answers (3)

ryandebaNovember 22, 2017

Unfortunately I am not aware of a simple way to get a specific component object without recursively iterating through them to find the one you want, but that sounds like a great idea! You might be able to do something like this to get all components and then filter for the one that you want (this c...

baxxosNovember 27, 2017

Thanks for your replies, I think my question has been answered and there's not much else to add. I'm closing this now, however the find() method would be a welcome addition to this awesome framework.

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.