Issue #1873💬 AnsweredOpened March 9, 2019by alialrabi1 reactions

Grid Component Resize Its cells width not works

快速解答by artf1

This is because the grid uses flex so you should use flex-basis for the width. In that case resizable should be an object like this { keyWidth: 'flex-basis' }

Read full answer below ↓

Question

Hi artf, i have a question when i implement grid component having row and three cells , i want to make these cells resiazable on width and height , So i make an event when component selected set it resizable =true , when resize cells height it works , but the cells width not affect yet when resize it , how i can make cells resizable. this is my code :

代码片段TEXT
blockmanager.add('my-grid', {
    label: 'Grid',
    category: 'Basic',
    content: '<div title= "grid" class="row" style="height:50px; border-width:0px"><div class="cell"></div><div class="cell"></div><div class="cell"></div></div>',
    attributes: {class:'gjs-fonts gjs-f-b3 gjs-block gjs-one-bg gjs-four-color-h'},
    style:{
        'width': '33vw',
    }  });

and the event is  : 

      editor.on('component:selected', function (args) {
        args.attributes.resizable = true;

    });

Answers (2)

artfMarch 10, 2019

This is because the grid uses flex so you should use flex-basis for the width. In that case resizable should be an object like this { keyWidth: 'flex-basis' }

lock[bot]March 10, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

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.