Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Closed
@AmandaZYJ

Description

@AmandaZYJ

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions