From a52ae7a4dc858ed77de4ce6c4ad60af6f4c7ab90 Mon Sep 17 00:00:00 2001 From: Pavel Reznikov Date: Sun, 23 Nov 2014 16:57:22 -0800 Subject: [PATCH] add remove_all method --- src/gridstack.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index 002b493..91f6144 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -439,6 +439,14 @@ this._update_container_height(); }; + GridStack.prototype.remove_all = function () { + _.each(this.grid.nodes, function (node) { + node.el.remove(); + }); + this.grid.nodes = []; + this._update_container_height(); + }; + GridStack.prototype.resizable = function (el, val) { el = $(el); el.each(function (index, el) {