Issue #2587✓ SolvedOpened February 19, 2020by PKRekha3 reactions

Custom component, Need 4 Columns at a time when I drag

快速解答by pouyamiralayi2

@PKRekha you can prevent the styling by setting `stylable property to false` and for having 4 instances of your component type, just go like this: Cheers!

Read full answer below ↓

Question

Hello @artf, I have created custom component, where I need to display 4 columns with specific style when I drag a component to the canvas and in each column again I have some html content with specific styles and again i have to give user to edit the content or image but not the styles. Can I have a example where anybody does this kind of functionality? as of now I have created a custom type for a column and static content with in the column, but I am stuck with remaining functionalities. please help to achieve this

Answers (3)

👍 Most helpfulpouyamiralayiFebruary 21, 2020

@PKRekha you can prevent the styling by setting stylable property to false and for having 4 instances of your component type, just go like this:

const bm = editor.BlockManager;

    bm.add('COLUMN', {
        label:'Column',
        content:`
            <div data-gjs-type="column-type"></div>   
            <div data-gjs-type="column-type"></div>   
            <div data-gjs-type="column-type"></div>   
            <div data-gjs-type="column-type"></div>   
        `
    })

Cheers!

JogaiFebruary 19, 2020

Please adjust title and follow the contents of the issue template

PKRekhaFebruary 19, 2020

Hello @artf , I have created custom component, where I need to display 4 columns with specific style when I drag a component to the canvas and in each column again I have some html content with specific styles and again i have to give user to edit the content or image but not the styles. Can I have a example where anybody does this kind of functionality? as of now I have created a custom type for a column and static content with in the column, but I am stuck with remaining functionalities. please help to achieve this

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.