Add a select-option to toolbar
I was able to manage it by modifying ToolbarButton and its view. But later I decided to expose them by adding those to DomComponents via separate property rather than modifying ToolBar..., so I can extend them and since the changes are few lines, I can easily merge it with new versions of the core. I'm not a javascrip...
Read full answer below ↓Question
I have read the code and only I could find out that there is only a list of ToolbarButton associated with the toolbar. I have a special trait that I would like to put it into the toolbar because it is very important to see the user which component has this trait and also to change it on the designer/canvas without having many clicks. And this select-option should only be available to some types of blocks. I think I can try to update the trait value via an event, if I can add a select-option to the tool bar. Appreciate any help.
Answers (3)
I was able to manage it by modifying ToolbarButton and its view. But later I decided to expose them by adding those to DomComponents via separate property rather than modifying ToolBar..., so I can extend them and since the changes are few lines, I can easily merge it with new versions of the core....
Hi @sura2k, I also want to add a select option to toolbar. Can you please share your ideas/code/script on how did you implement it?
Thanks in advance.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Related Questions and Answers
Continue research with similar issue discussions.
Issue #850
[Question]: Component:Moved Event
What I'm trying to accomplish: I have a piece of code I need to run when a component is "dropped". I put "dropped" in quotes, because it ne...
Issue #841
[QUESTION] Add default Trait (attribute) to model for all HTML Components (elements)
Hi, I've read the Traits, Components and API wikis, grepped all the open & closed issues. I've even found the code where you are creating t...
Issue #1540
[Question] Is it possible to add event for preview?
I'd like to convert some texts when a user clicks the preview button. for instance, ((name)) (in the editor) should be 'David' (in preview...
Issue #1864
[QUESTION] Best way to listen to changes on the final HTML?
Hi, I just had a quick question because I could not figure out how to do it or did not find an issue related to it. I am just trying to cal...
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.
Browse Plugin Categories
Jump directly to plugin category pages on the marketplace.