Issue #3237💬 AnsweredOpened January 15, 2021by Abhisheknanda13444632 reactions

Add Trait For wrapper

Quick answerby artf1

You can use this option from components on init https://github.com/artf/grapesjs/blob/69e5ab2c1176e6fdeac1b058398cca55efe92df3/src/dom_components/config/config.js#L9 PS: stop annoying other people with your issues, please or I have to block you from this repo

Read full answer below ↓

Question

Hi @artf
I've added trait for wrapper this way. How can I perform the init function for the same Here is the code

  editor.getWrapper().set('traits',
    [
      {
        changeProp: 1,
        name: 'abc',
        label: 'abc',
        type: 'checkbox',
        changeProp: 1
      },
    ],
  )

@artf Could you please help me? Thanks.

Answers (4)

Abhisheknanda1344463January 28, 2021

Sorry @artf I'll keep this in mind. Thanks

Abhisheknanda1344463January 22, 2021

@ryandeba Any suggestion?

GJSBlockMay 17, 2026

Thanks for reporting this, @Abhisheknanda1344463. Great question about Add Trait For wrapper. The recommended approach with GrapesJS is to use the event-driven API. Start here: Check the GrapesJS documentation for your specific module Look for the on() event listener method Most operations can be a...

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 →

Related tutorials

In-depth guides on the same topic.

All tutorials →

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.