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 set a predefined height or width for “grid-stack-item” with acceptWidgets #918

Closed
rafael-trevisan opened this issue Jul 10, 2018 · 1 comment

Comments

@rafael-trevisan
Copy link

rafael-trevisan commented Jul 10, 2018

I'm using gridstack with acceptWidgets to drag-and-drop widgets from a left side panel to the main panel, kind of similar to http://gridstackjs.com/demo/two.html

In my case, I want to set height, width and other item attributes to my "grid-stack-item" so then when they're dropped they'd have some pre-defined height and width. However, setting up those attributes won't affect when the item is dropped in the gridstack.

Here is a JSFiddle: https://jsfiddle.net/trevisan/wt7bg6s1/8/

Note that the "Drag me" element has data-gs-width="6" which I expected to make it stretch as my gridstack has 6 columns.

<div class="grid-stack-item" data-gs-width="6">
  <div class="grid-stack-item-content">Drag me</div>
</div>

I have tried to call makeWidget method but then I end up having two widgets on my gridstack.

Does anyone have an idea how to figure that out?

@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

2 participants