Issue #620Opened December 7, 2017by xeux0 reactions

Remote Storage

Question

I'm trying to use the remote storage but no success, with the resolved issues I manage to adjust eveything as it best, but editor do not render loaded HTML.

GrapesJS:

var editor = grapesjs.init({
	container : '#gjs',
	storageManager: {
		type: 'remote',
		autoload: true,
		stepsBeforeSave: 10,
		contentTypeJson: true,
		urlStore: 'domain.dev/store',
		urlLoad: 'domain.dev/load',
		params: {},
	},
	showDevices: false,
	plugins: ['gjs-blocks-basic'],
	pluginsOpts: {
		'gjs-blocks-basic': {/* ...options */}
	}
});

editor.on('storage:load', function(e) {
      console.log('Loaded ', e);
	  editor.render();
});

JSON: {"gjs-css":"", "gjs-html":"<div>HELLO</div>", "gjs-assets":"[]", "gjs-styles":"[]", "gjs-components":"[]"}

Load event: image

GrapesJS seems to be loading okay, I put the editor.render() after the init and also inside the load event to try out.

Answers (3)

DeathStaplerDecember 7, 20170 reactions

I had similar problems. Look at the issue I created. Issue #597.

My issue related to the use of contentTypeJson: true, but you already have that in yours.

artfDecember 8, 20170 reactions

GrapesJS seems to be loading okay, I put the editor.render() after the init and also inside the load event to try out.

You should use editor.render() only with autorender: 0, so remove it

xeuxDecember 8, 20170 reactions

@DeathStapler thanks, I was able to load the urlLoad with that setting.

@artf still not able to render the editor, the console shows the loaded urlLoad but nothing on editor, also in the view source button.

I'm using the latest version.

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.