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

an exception happens when I drag one widge to another(acceptWidgets :true) #803

Closed
AmandaZYJ opened this issue Oct 19, 2017 · 5 comments
Closed

Comments

@AmandaZYJ
Copy link

AmandaZYJ commented Oct 19, 2017

Subject of the issue

i can drag widge between two placeholder,it seems fine on browser but actually an exception happens
this is the exception
gridstack.js:885 Uncaught TypeError: Cannot set property '_grid' of undefined
at HTMLDivElement. (http://localhost/datav/base/plugins/grid/gridstack.js:885:32)
at HTMLDivElement.dispatch (http://localhost/datav/base/common/js/jquery-2.1.4.js:4435:9)
at HTMLDivElement.elemData.handle (http://localhost/datav/base/common/js/jquery-2.1.4.js:4121:28)
at Object.trigger (http://localhost/datav/base/common/js/jquery-2.1.4.js:4350:12)
at HTMLDivElement. (http://localhost/datav/base/common/js/jquery-2.1.4.js:4901:17)
at Function.each (http://localhost/datav/base/common/js/jquery-2.1.4.js:374:23)
at jQuery.fn.init.each (http://localhost/datav/base/common/js/jquery-2.1.4.js:139:17)
at jQuery.fn.init.trigger (http://localhost/datav/base/common/js/jquery-2.1.4.js:4900:15)
at t.(anonymous function).(anonymous function)._trigger (http://localhost/datav/base/plugins/datav/js/jquery-ui.min.js:6:11056)
at t.(anonymous function).(anonymous function)._drop (http://localhost/datav/base/plugins/datav/js/jquery-ui.min.js:11:12603)

Your environment

  • version of gridstack.js
  • which browser and its version

Steps to reproduce

	        <br/>
	        <div class="grid-stack">
	    
		        <div class="grid-stack-item " data-gs-x="4" data-gs-y="0" data-gs-width="4" data-gs-height="4" >
		                <div class="grid-stack-item-content" style="background-color:lightblue;color:lightblue">

		                        <div class="grid-stack">
		                            <div class="grid-stack-item" data-gs-x="0" data-gs-y="0" data-gs-width="3" data-gs-height="1"><div class="grid-stack-item-content">1</div></div>
		                            <div class="grid-stack-item" data-gs-x="3" data-gs-y="0" data-gs-width="3" data-gs-height="2"><div class="grid-stack-item-content">2</div></div>
		                            <div class="grid-stack-item" data-gs-x="6" data-gs-y="0" data-gs-width="3" data-gs-height="3"><div class="grid-stack-item-content">3</div></div>
		                            <div class="grid-stack-item" data-gs-x="9" data-gs-y="0" data-gs-width="3" data-gs-height="4"><div class="grid-stack-item-content">4</div></div>

		                        </div>

		                </div>
	            </div>
	        </div>

$(function () {
var options = {
cell_height: 80,
verticalMargin:2,
acceptWidgets: true
};
$('.grid-stack').gridstack(options);
});

Expected behaviour

Tell us what should happen

Actual behaviour

Tell us what happens instead

@cyrilis
Copy link

cyrilis commented Nov 29, 2017

Got this error too, anybody knows why this occurs?

@radiolips
Copy link
Member

This is resolved in current v0.4.0.

@mishrarajesh
Copy link

v0.4.0.

This is resolved in current v0.4.0.

I still see this issue in v0.4.0. Is there any work around for this.
Uncaught TypeError: Cannot set property '_grid' of undefined
at HTMLDivElement. (gridstack.js:859)

Steps:

1. I have Empty grid with acceptWidgets :true.
2. Dropping widget from jqueryUi draggable.
3. resize/ move the widget which is dropped.
4. Try to drop one more new widget.
    4.1 No places holder is shown.
    4.2 On drop the above js error comes.
![image](https://user-images.githubusercontent.com/2945439/49431995-b238e280-f7d4-11e8-8cda-0ffdd0cdda24.png)

@jploch
Copy link

jploch commented Dec 2, 2019

  1. I have Empty grid with acceptWidgets :true.
  2. Dropping widget from jqueryUi draggable.
  3. resize/ move the widget which is dropped.
  4. Try to drop one more new widget.
    4.1 No places holder is shown.
    4.2 On drop the above js error comes.

I have the same issue, even with the newest version (v0.5.5)

@adumesny adumesny reopened this Dec 2, 2019
@adumesny
Copy link
Member

I'm pretty sure I ran into this ("fixed error when dragging add item over the trash, and then over second grid" commit msg) and fixed the assert it as part of #1096
please use latest 0.5.5-dev code and let me know - in the next release.

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

6 participants