Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to change the default width and height of grid stack placeholder? #914

Closed
jun1432 opened this issue Jun 29, 2018 · 14 comments
Closed

How to change the default width and height of grid stack placeholder? #914

jun1432 opened this issue Jun 29, 2018 · 14 comments

Comments

@jun1432
Copy link

jun1432 commented Jun 29, 2018

I'm referring to the dashed line when your dragging a widget.

@jun1432
Copy link
Author

jun1432 commented Jun 29, 2018

For example the default value for now is data-gs-width="2" and data-gs-height="3". I want to change this to value. I'm thinking of having the data value of grid stack item's width and height.

I'm referring to the below classes.
[css]
.grid-stack .grid-stack-placeholder > .placeholder-content { border:1px dashed #d3d3d3; }

[html]
{default values below}
<div class="grid-stack-placeholder grid-stack-item" data-gs-x="0" data-gs-y="4" data-gs-width="2" data-gs-height="3"></div>

I want to edit these default values manually or dynamically. I hope I explained well my issue.

Thanks and more power.

@jun1432
Copy link
Author

jun1432 commented Jul 2, 2018

Hi Guys,

For more info on the issue, below is a screenshot on the element that has this default value that I want to change.

http://www.screencast.com/t/OV3B53WBS

@radiolips
Copy link
Member

The value is the size of the widget. What are you trying to change it to?

@jun1432
Copy link
Author

jun1432 commented Jul 2, 2018

I want to change the default value of data-gs-width="6" and data-gs-height="4"

@radiolips
Copy link
Member

Those values are set to that because they're the values of the widget you're moving. The placeholder will always reflect the size of the widget.

@jun1432
Copy link
Author

jun1432 commented Jul 2, 2018

Thanks @radiolips.

@ygalanter
Copy link

Maybe related - how to change the granularity of "snap to" when resizing a widget?

@Hedva
Copy link

Hedva commented Aug 7, 2018

Those values are set to that because they're the values of the widget you're moving. The placeholder will always reflect the size of the widget.

@radiolips That doesn't seem true when you use the 'sidebar' of Two Grid Demo

How can you change the size in that case?

@ermcgrat
Copy link

ermcgrat commented Aug 8, 2018

@Hedva Also curious about this. That "drag me" item doesn't have any sizes specified, but becomes a 2x2 when dropping into either grid.

@ermcgrat
Copy link

ermcgrat commented Aug 8, 2018

Given that sidebar example of the two grid demo, I'm wondering if it is possible to achieve something similar to the Azure Portal. That is, the widget that you start dragging could be a different size than what it occupies in a grid. For example, all of the items are 1x1 in the sidebar but occupy something larger in the grid. Here is a screenshot for example, notice how the Clock item while being dragged occupies 2x2 on the grid, even though its ghosted image is smaller.

https://i.imgur.com/w2YrcmB.png

@lauantai
Copy link

lauantai commented Aug 8, 2018 via email

@Hedva
Copy link

Hedva commented Aug 13, 2018

@lauantai I would be really grateful if you can provide an example in the near future. Can't figure it out yet

@ermcgrat
Copy link

Hey guys, I found a workaround that may be helpful if this issue still pertains to you

#933

@adumesny
Copy link
Member

adumesny commented Dec 23, 2019

real fix in #1107 - sorry it took so long

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants