Issue #2671💬 AnsweredOpened March 20, 2020by TrungLeIT0 reactions

How to handle more sector of traits

快速解答by artf

At the moment you can render only one container of traits, so you can't split them

Read full answer below ↓

Question

代码片段TEXT
I want to add more Structure sector as below :
// Add Settings Sector
        var traitsSector = $('<div class="gjs-sm-sector no-select">'+
          '<div class="gjs-sm-title"><span class="icon-settings fa fa-cog"></span> Settings</div>' +
          '<div class="gjs-sm-properties" style="display: none;"></div></div>');
        var traitsProps = traitsSector.find('.gjs-sm-properties');
        traitsProps.append($('.gjs-trt-traits'));
        $('.gjs-sm-sectors').before(traitsSector);
        traitsSector.find('.gjs-sm-title').on('click', function(){
          var traitStyle = traitsProps.get(0).style;
          var hidden = traitStyle.display == 'none';
          if (hidden) {
            traitStyle.display = 'block';
          } else {
            traitStyle.display = 'none';
          }
        });
		
		// Add Settings Structure
        var traitsSector_more = $('<div class="gjs-sm-sector no-select">'+
          '<div class="gjs-sm-title"><span class="icon-settings fa fa-cog"></span> Structure</div>' +
          '<div class="gjs-sm-properties" style="display: none;"></div></div>');
        var traitsProps_more = traitsSector_more.find('.gjs-sm-properties');
        traitsProps_more.append($('.gjs-trt-traits'));
        $('.gjs-sm-sectors').before(traitsSector_more);
        traitsSector_more.find('.gjs-sm-title').on('click', function(){
          var traitStyle_more = traitsProps_more.get(0).style;
          var hidden = traitStyle_more.display == 'none';
          if (hidden) {
            traitStyle_more.display = 'block';
          } else {
            traitStyle_more.display = 'none';
          }
        });
I don't know what to do that I may be handle blinding data into the above 2 sector when I click on any the component.
as far as I can see Its problems :
![Capturecs](https://user-images.githubusercontent.com/55629233/77134003-c53df780-6a97-11ea-81e7-7cb586cfd08d.PNG)

Answers (2)

artfMarch 21, 2020

At the moment you can render only one container of traits, so you can't split them

gunslingorAugust 24, 2020

I'm confused about the demo and this answer. Why is it that I can configure the general, dimension, etc sections at init but not Settings/Traits or others. Also, you can't add arbitrary sections to the presets during init? I'm surprised, especially cause the docs say I should be able to: "customStyleManager - Use custom set of sectors for the Style Manager". I replicated General and tried renaming to Traits, Settings and something random but no sections were added.

customStyleManager | Use custom set of sectors for the Style Manager

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.