Closed
Description
Hello,
The destroy method with parameter false
, doesn't remove the "data" object attach to the DOM.
Here is a example:
$('.grid-stack').gridstack(options);
var gridStack = $('.grid-stack').data("gridstack");
console.debug(gridStack); // { Object }
gridStack.destroy(false);
var gridStack = $('.grid-stack').data("gridstack");
console.debug(gridStack); // { Object } **!!!!**
The problem with that if when, then, on the same DOM element I do:
$('.grid-stack').gridstack(options); //Will do nothing!
This code do nothing because the first thing you do is:
$.fn.gridstack = function(opts) {
return this.each(function() {
var o = $(this);
if (!o.data('gridstack')) { // <= this will never be true, because destroy doesn't have removed this data object
o
.data('gridstack', new GridStack(this, opts));
}
});
};