Model.get('toolbar') always return null
The extendFn was added from https://github.com/artf/grapesjs/releases/tag/v0.14.61 in the demo you're using the 0.14.57
Read full answer below ↓Question
Hi @artf I am trying to add a custom toolbar to my custom component without changing the default toolbar. So I expect it to be like [movable, copyable, removable, newToolbar]. I use this #266 as a reference. But strangely this.get('toolbar') always return null. Is this something normal? I got this instead
Answers (3)
The extendFn was added from https://github.com/artf/grapesjs/releases/tag/v0.14.61 in the demo you're using the 0.14.57
I am so sorry, it's my mistake. Thanks for your guidance
Yes, if you override the original initToolbar method the toolbar property is never created, so you have to call the parent one first. Try with this component creation helper
extendFn: ['initToolbar'], // array of model functions to extend
model: {
// ...
initToolbar () {
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2697
[QUESTION] Problem with custom component type and table cell
Hello! I'm trying to add custom component type: And also I'm adding new block: But when I drop this block on the canvas the <td> tag doesn'...
Issue #2943
BUG: this.get('content') returns empty string when trying to add custom component type
Version: 0.16.18 Are you able to reproduce the bug from the demo?>> Demo <<< [ X ] Yes [ ] No What is the expected behavior? Expecting this...
Issue #2777
[QUESTION] How to update styles in Style Manager
Hello. I created custom component where I set backgraound-image via custom asset manager Custom block code: Command which I run to set new...
Issue #3627
[QUESTION]: I'm trying to duplicate the page, but the styles are not geting applied due to the Ids, changes to -2,-3 at the end.
This is what my function looks like. I am trying duplicate the page, the HTML part is fine but as css is applied through ids, when a new pa...
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 →Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.