Issue #2007πŸ’¬ AnsweredOpened May 10, 2019by kaoz701 reactions

Adding new traits to component and update current ones with these

Quick answerby kaoz70❀ 1

@Lakshit-Singhal In that case I think the best option would be to create a custom plugin, and before you initialize GrapesJS, call the API, get the values and pass them in the initialization function via the plugin's options, that way they are present when the trait gets initialized. Check the documentation on how to...

Read full answer below ↓

Question

I have some custom components created before modifying their traits (for example, I created a new trait for it), these components wont contain the new trait. If I drag a new component into the editor, it will have it. Steps to reproduce: 1) Create a custom component and compile the code 2) Drag this custom component into the editor 3) Save the changes to DB 4) Modify the component by adding a new trait and compile again 5) Load the components from DB 6) Loaded components wont have the new trait I load and save all the data into the database: styles, css, components,and html. load(keys, clb, c...

Answers (3)

kaoz70β€’ November 19, 2019

@Lakshit-Singhal In that case I think the best option would be to create a custom plugin, and before you initialize GrapesJS, call the API, get the values and pass them in the initialization function via the plugin's options, that way they are present when the trait gets initialized. Check the docu...

artfβ€’ May 12, 2019

This happens because the editor stores also traits information in components. You can delete this information be extending the component and updating its toJSON method ps: I think I'll remove traits from JSON in the next release. Perhaps many versions back that would have made sense, but now I'd no...

ahmedeldeeb25-zzβ€’ May 12, 2019

@artf this removed custom traits !! as I mentioned in #2007

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 β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.