Issue #2982Opened August 28, 2020by mitcht0 reactions

BUG: Executing editor.load(x) on x = editor.store() results in error.

Question

Version: 0.16.18

Are you able to reproduce the bug from the demo? [X ] Yes [ ] No

What is the expected behavior? I would expect that assets, components, css, html, and styles would be repopulated.

Describe the bug detailed I am working on an existing system that has a database schema preventing me from using the StorageManager built into grapesjs. I am attempting to store the current state of the GrapesJS editor into a javascript variable, and then reload it - using editor.store() and editor.load() respectively. According to the documentation, these features are listed as part of the editor, not the storage manager (https://grapesjs.com/docs/api/editor.html#store) and would be expected to compliment each other.

What is the current behavior? var x = editor.store(); editor.load(x);

This results in an error. I would expect to just reload the current data.

Are you able to attach screenshots, screencasts or a live demo?

[X ] Yes (attach) [ ] No

image

Answers (3)

mitchtAugust 28, 20200 reactions

Yes, I see that .load takes a callback function. I'll admit, I'm probably doing this wrong. I only started using grapesJS a few days ago. If my bug report is not truly a bug, how would one store the current state of the editor (possibly as json), then reload it?

Is there a specific function to call that accepts a variable structured like the output from editor.store(), or must I call setHtml, setStyle, etc.. individually?

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...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.