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

Method add

angular/projects/demo/src/app/app.component.ts:176–180  ·  view source on GitHub ↗

* TEST dynamic grid operations - uses grid API directly (since we don't track structure that gets out of sync)

()

Source from the content-addressed store, hash-verified

174 * TEST dynamic grid operations - uses grid API directly (since we don't track structure that gets out of sync)
175 */
176 public add() {
177 // TODO: BUG the content doesn't appear until widget is moved around (or another created). Need to force
178 // angular detection changes...
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;

Callers 15

disableMethod · 0.45
_setupHelperStyleMethod · 0.45
constructorMethod · 0.45
_updateColumnVarMethod · 0.45
setAnimationMethod · 0.45
updateOptionsMethod · 0.45
resizeToContentMethod · 0.45
_prepareElementMethod · 0.45
_setStaticClassMethod · 0.45
_itemRemovingMethod · 0.45
prepareDragDropMethod · 0.45
_initMethod · 0.45

Calls 1

addWidgetMethod · 0.80

Tested by

no test coverage detected