gridstack.js icon indicating copy to clipboard operation
gridstack.js copied to clipboard

Changing Column padding and resize width

Open qorrect opened this issue 11 years ago • 7 comments

When I try to resize a cell within a row, it only allows me to resize by big jumps.

I'm looking for a config that does what cell_height does, is there a cell_width option ?

Thanks for such a great plugin!

qorrect avatar Apr 06 '15 23:04 qorrect

Did you find a solution for that? Cause iam running into the exact same problem.

cfleck avatar Jun 15 '15 06:06 cfleck

No I haven't , I'll start digging into the code though

qorrect avatar Jun 15 '15 12:06 qorrect

@cfleck ok I got it working. Upgrade to the latest version and replace all the CSS that deals with data-gs-width percentages to the new one created by the script in the readme, and add width and 'data-gs-width' properties to your constructor.

qorrect avatar Oct 01 '15 21:10 qorrect

@qbert65536 Can you please provide your code snippet?

yulisys avatar Oct 15 '15 08:10 yulisys

i will look into that. Thanks in advance :-)

cfleck avatar Oct 15 '15 08:10 cfleck

@yulisys take the SASS code from here https://github.com/troolee/gridstack.js, change to your number of columns, then remove all the mentions in gridstack.css about columns and width ( just overriding it didn't seem to work I had to actually cut out the old CSS ).

Then change your constructor to something like :

var gridOptions = { ..., width: 36, 'data-gs-animate': true, 'data-gs-width': 36 }; $('.grid-stack').gridstack(gridOptions);

That worked for me. When I changed it to 36, I had to set the minimum width for 2 , other size one sized columns would drag around weird, I should probably file a ticket

qorrect avatar Oct 15 '15 16:10 qorrect

Closing because the CSS allows for this, as mentioned. Please reopen if you consider your issue not resolved. Thanks!

radiolips avatar Feb 18 '16 15:02 radiolips