* Removes all widgets from the grid. * @param removeDOM if `false` DOM elements won't be removed from the tree (Default? `true`). * @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true).
(removeDOM = true, triggerEvent = true)
| 1426 | * @param triggerEvent if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default? true). |
| 1427 | */ |
| 1428 | public removeAll(removeDOM = true, triggerEvent = true): GridStack { |
| 1429 | // always remove our DOM data (circular link) before list gets emptied and drag&drop permanently |
| 1430 | this.engine.nodes.forEach(n => { |
| 1431 | if (removeDOM && GridStack.addRemoveCB) { |
| 1432 | GridStack.addRemoveCB(this.el, n, false, false); |
| 1433 | } |
| 1434 | delete n.el.gridstackNode; |
| 1435 | if (!this.opts.staticGrid) this._removeDD(n.el); |
| 1436 | }); |
| 1437 | this.engine.removeAll(removeDOM, triggerEvent); |
| 1438 | if (triggerEvent) this._triggerRemoveEvent(); |
| 1439 | return this; |
| 1440 | } |
| 1441 | |
| 1442 | /** |
| 1443 | * Toggle the grid animation state. Toggles the `grid-stack-animate` class. |
no test coverage detected