Issue #849πŸ’¬ AnsweredOpened February 8, 2018by ajwootto1 reactions

Ability to unload and destroy the editor instance or reload the config options?

Quick answerby maxtacco❀ 1

You can access RemoteStorage and update urls at any time:

Read full answer below ↓

Question

In my use case, I'm trying to change the store and load URLs used by the remote storage manager dynamically. As far as I can tell, the editor does not pick up and use any changes to the config if I change them directly, ie. after the editor has already been initialized. To try and get around it, I was attempting to unload the editor from the page programmatically by removing the target DOM element and recalling init. However, the init function seems to create multiple instances of the editor. I noticed the GrapesJS.editors array keeping track of them, so I tried setting this to empty to hopef...

Answers (3)

maxtaccoβ€’ February 8, 2018

You can access RemoteStorage and update urls at any time:

    const RemoteStorage = editor.StorageManager.get('remote');
    RemoteStorage.set('urlLoad', [urlLoad]);
    RemoteStorage.set('urlStore', [urlStore]);
ajwoottoβ€’ February 8, 2018

Both of those options would probably work, however something I forgot to mention is that in some cases, I want to re-initialize the editor with components and styles pre-specified (ie. passing them in the init) rather than loading them from remote storage, but in other cases I want the initial cont...

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.