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

gridstack horizontal spacing between dynamically loaded pivotwidgets is too high

Open Sreelakshmigc opened this issue 9 years ago • 3 comments

I am using pivottable interface to plot the widgets and have used gridstack to place them in grids. I am using grid-stack-item, ui-draggable, ui-resizable classes. When I try to resize the widget, the horizontal spacing between the widget is very large :

gridstackexample

but I see that data-gs-x, data-gs-y, data-gs-width and data-gs-height are getting incremented by 1 when I drag or resize the widgets.

Please provide me a solution to decrease this horizontal spacing between the items.

I want it to look like the gridstack demo grids https://troolee.github.io/gridstack.js/

Sreelakshmigc avatar Mar 17 '17 06:03 Sreelakshmigc

Hello Sreelakshmigc!

what i did do was to add this to the gridstack.css

.grid-stack .grid-stack-item .grid-stack-item-content, .grid-stack .grid-stack-item .placeholder-content { left: 2px; right: 2px; bottom: -4px; top: -6px; }

you can choose the spacement you want by changing the px, that was the spacement that i wanted. i hope it helped you

ghost avatar Apr 05 '17 09:04 ghost

@Sreelakshmigc I don't understand why you're seeing a gutter that large. It looks like you have two touching to the right?

After re-reading, I think I understand what you're saying. You are moving one space, and it's jumping that far. Here's why: gridstack assumes 12 columns. It's taking your space and dividing it by 12. By modifying the CSS and passing in an option, you can make it fewer columns. Let me know if this doesn't help.

radiolips avatar Apr 19 '17 16:04 radiolips

Hi @radiolips Thank you for your response. Can you please elaborate on how this can be done ? I am loading gridstack.min.css from the cdnjs. I am not able to find exactly which classes to be used in my local css file to overwrite the default values. Or do I need to save the gridstack.min.css file in my code and make changes there. Thanks again in advance. Hoping to get a quick response.

Sreelakshmigc avatar Apr 25 '17 13:04 Sreelakshmigc