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

Method compact

src/gridstack.ts:1007–1011  ·  view source on GitHub ↗

* Re-layout grid items to reclaim any empty space. This is useful after removing widgets * or when you want to optimize the layout. * * @param layout layout type. Options: * - 'compact' (default): might re-order items to fill any empty space * - 'list': keep the widget left->right

(layout: CompactOptions = 'compact', doSort = true)

Source from the content-addressed store, hash-verified

1005 * grid.compact('compact', false);
1006 */
1007 public compact(layout: CompactOptions = 'compact', doSort = true): GridStack {
1008 this.engine.compact(layout, doSort);
1009 this._triggerChangeEvent();
1010 return this;
1011 }
1012
1013 /**
1014 * Set the number of columns in the grid. Will update existing widgets to conform to new number of columns,

Callers 2

gridstack-spec.tsFile · 0.45

Calls 1

_triggerChangeEventMethod · 0.95

Tested by

no test coverage detected