How to remove trait fields dynamically?
Found the solutions in the updated dev versions. component.removeTrait('title');
Read full answer below ↓Question
Hi @artf ,
I have a drop down with few options. Based on the selection fields are getting generated using addTrait. Similar way is there any removeTrait function?
Ex: If I choose Option1, 'field-1' will be generated. If I choose Option2, 'field-1' should be removed and 'field-2' should be added .
Answers (1)
Found the solutions in the updated dev versions.
component.removeTrait('title');
Related Questions and Answers
Continue research with similar issue discussions.
Issue #2027
[QUESTIONS] How to add traits dynamically based on the dropdown selection
Hi @artf , I have a custom component with custom traits. When I select the option from the dropdown, more fields needs to be added based on...
Issue #1780
How to change extra dropdown for link change trait
Hello @artf , I want to give one more functionality to user like user can change any link with default links drop down. In above image i wa...
Issue #1307
Question: To stop dynamically generated classes in grapes Editor
Hi @artf is there any Way to stop dynamically generating classes on reloading editor. let say when i add my custom class i.e "my_class" to...
Issue #5046
is there any way to remove cross svg on selected default value of Float, Position and text-align
GrapesJS version [X] I confirm to use the latest version of GrapesJS What browser are you using? Version 111.0.5563.147 (Official Build) (6...
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.