MCPcopy Index your code
hub / github.com/gridstack/gridstack.js / delete

Method delete

angular/projects/demo/src/app/app.component.ts:181–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

179 this.gridComp?.grid?.addWidget({x:3, y:0, w:2, content:`item ${ids}`, id:String(ids++)});
180 }
181 public delete() {
182 let grid = this.gridComp?.grid;
183 if (!grid) return;
184 let node = grid.engine.nodes[0];
185 // delete any children first before subGrid itself...
186 if (node?.subGrid && node.subGrid.engine.nodes.length) {
187 grid = node.subGrid;
188 node = grid.engine.nodes[0];
189 }
190 if (node) grid.removeWidget(node.el!);
191 }
192 public modify() {
193 this.gridComp?.grid?.update(this.gridComp?.grid.engine.nodes[0]?.el!, {w:3})
194 }

Callers 3

GridStackProviderFunction · 0.45
GridStackRenderProviderFunction · 0.45

Calls 1

removeWidgetMethod · 0.80

Tested by

no test coverage detected