Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Change log
You can now have perfect square cells (default) [723](https://github.com/gridstack/gridstack.js/issues/723)
- fix [1299](https://github.com/gridstack/gridstack.js/pull/1299) many columns round-off error
- fix [1102](https://github.com/gridstack/gridstack.js/issues/1102) loose functionality when they are moved to a new grid
- add optional params to `removeWidget()` to have quiet mode (no callbacks)

## 1.2.0 (2020-08-01)

Expand Down
9 changes: 5 additions & 4 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ gridstack.js API
- [minWidth(el, val)](#minwidthel-val)
- [movable(el, val)](#movableel-val)
- [move(el, x, y)](#moveel-x-y)
- [removeWidget(el[, removeDOM])](#removewidgetel-removedom)
- [removeAll([removeDOM])](#removeallremovedom)
- [removeWidget(el, removeDOM = true, triggerEvent = true)](#removewidgetel-removedom--true-triggerevent--true)
- [removeAll(removeDOM = true)](#removeallremovedom--true)
- [resize(el, width, height)](#resizeel-width-height)
- [resizable(el, val)](#resizableel-val)
- [save(): GridStackWidget[]](#save-gridstackwidget)
Expand Down Expand Up @@ -464,16 +464,17 @@ Parameters:
- `el` - widget to move
- `x`, `y` - new position. If value is `null` or `undefined` it will be ignored.

### removeWidget(el[, removeDOM])
### removeWidget(el, removeDOM = true, triggerEvent = true)

Removes widget from the grid.

Parameters:

- `el` - widget to remove.
- `removeDOM` - if `false` node won't be removed from the DOM (Optional. Default `true`).
- `triggerEvent` if `false` (quiet mode) element will not be added to removed list and no 'removed' callbacks will be called (Default `true`).

### removeAll([removeDOM])
### removeAll(removeDOM = true)

Removes all widgets from the grid.

Expand Down
1 change: 1 addition & 0 deletions src/gridstack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,7 @@ export class GridStack {
* Removes widget from the grid.
* @param el widget or selector to modify
* @param removeDOM if `false` DOM element 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).
*/
public removeWidget(els: GridStackElement, removeDOM = true, triggerEvent = true): GridStack {
this.getElements(els).forEach(el => {
Expand Down