dsmorse / gridster.js

gridster.js is a jQuery plugin that makes building intuitive draggable layouts from elements spanning multiple columns

Home Page:http://dsmorse.github.io/gridster.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUG: Destroy() and re-intialize fails to allow draggable

timothymarois opened this issue · comments

The destroy method seems to work, bu when you try to add gridster back on, draggable elements are no longer functional, the grid resizes and aligns the widgets correctly, but they're no longer draggable.

The issue I came across is reactive data, so destroying when data is updated and rebuilding gridster with updated reactive data on the HTML end, was the plan, but looks like you can not add gridster back after destroying.

The console has no errors, something else has cut off from running.

Add widgets by HTML is ok, but being able to add widgets by outside source, where you can have gridster.refresh() would be really ideal for reactive data.

Commenting this out in the gidster.js file on destroy()

if (this.drag_api) {
	this.drag_api.destroy();
}

Now dragging works when re-initializing. Though without further details, not sure whats going on with that if it will just leak memory over time. Looks like destroy does some damage to the drag API