Issue #2379✓ SolvedOpened November 5, 2019by gentritabazi2 reactions

Update Content Before Load

Quick answerby artf2

@gentritabazi01 here you can use component.components(data.html) this will replace the content with a new one returned from the server

Read full answer below ↓

Question

I have build one CMS in Laravel and i used GrapesJS to make Page Builder its perfect, i just created one component for "Posts" so users can select category where wants to select posts also limit. After select or change limit or category a request is made to a request to backend to show me data in JSON and i append to GrapesJS. I save all page content to database via command of GrapesJS: `editor.store().html` Now how i can make to load fresh posts from Database from that category (Pic 1 & 2) that selected in builder. Because GrapesJS show me only html code. [Component Picture 1][1] [Component...

Answers (2)

👍 Most helpfulartfNovember 7, 2019

@gentritabazi01

here

if(data.status == 'success') {
	component.set('content', data.html);
}

you can use component.components(data.html) this will replace the content with a new one returned from the server

pouyamiralayiNovember 6, 2019

@gentritabazi01 as far as i know, relying on editor storage for your custom data layer logic is not a good idea.I save all page content to database via command of GrapesJS: editor.store().html you can use: above code can be inside init hook of either your model or your view definition. that way you...

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.