Block render function not trigger
The block manager doesn't see the change if you do this block.attributes.render = .... You have to update the property explicitly in this way: And be careful, the render function SHOULD return the HTML string or the DOM node, NOT a Promise. If you need to do something async, at first resolve it, THEN update the render...
Read full answer below βQuestion
@artf - In the documentation, it says that If we need to customize the aspect of each block preview we can pass a render callback function in the block. But here is the actual thing Basically, I wrapped this render callback in a function named func() and calling it on some ajax request If I call this on page load it works but if I try to call this func() function after page load on some click event/handler or API response this render callback inside that function doesn't trigger
Answers (2)
The block manager doesn't see the change if you do this block.attributes.render = .... You have to update the property explicitly in this way: And be careful, the render function SHOULD return the HTML string or the DOM node, NOT a Promise. If you need to do something async, at first resolve it, TH...
Thanks for reporting this, @mohd7469. Thanks for sharing your report about block render function not trigger. To help the team investigate and prioritize this: Please provide: A minimal reproducible example (CodeSandbox/JSFiddle) Your GrapesJS version number Browser and OS information Any error mes...
Related Questions and Answers
Continue research with similar issue discussions.
Issue #3663
Default styling properties are not being re-selected when switiching devices
Hi, Default styling properties are not being selected when switching devices. Steps to reproduce: Open [http://grapesjs.com/demo.html] Sele...
Issue #3303
Category order not displaying properly
Hi! I want to display the categories in block manager in certain sequence. I looked into docs and previous issues and found about order att...
Issue #3251
How can I specify position of dropped element ?
I want to specify the position of dragging element. for example, if I have a header block which no matter where you drag, it should be plac...
Issue #3619
How to add video upload and save to backend?
Hi artf, I have implemented image upload with multiple images and save it to remote database. Same way how to upload single video and save...
Paid Plugins That Match This Issue
Curated by issue keywords and label relevance to help you ship faster.
Loading paid plugin recommendations...
Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.
Browse free plugins β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.
Tutorial
Building an AI-Assisted Document Engine with Next.js, GrapesJS, and the AI SDK
Transform your static template editor into an intelligent, generative design workspace with Vercel AI SDK, AI Elements and Next.js.
Tutorial
How to build a GrapesJS desktop app with Electron (complete guide 2026)
Run GrapesJS inside an Electron desktop app: mount it in the renderer, save projects to disk through IPC, and export HTML/CSS.
Tutorial
How to Build a Production GrapesJS Editor: The Complete Walkthrough of Brief, Preset, Plugins, and Services
A complete walkthrough of building a production GrapesJS editor: how to choose a preset, pick plugins, and scope setup services without burning a sprint.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.