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

Method movable

src/gridstack.ts:2230–2239  ·  view source on GitHub ↗

* Enables/Disables dragging by the user for specific grid elements. * For all items and future items, use enableMove() instead. No-op for static grids. * * Note: If you want to prevent an item from moving due to being pushed around by another * during collision, use the 'locked' property

(els: GridStackElement, val: boolean)

Source from the content-addressed store, hash-verified

2228 * grid.movable('#fixed-widget', false);
2229 */
2230 public movable(els: GridStackElement, val: boolean): GridStack {
2231 if (this.opts.staticGrid) return this; // can't move a static grid!
2232 GridStack.getElements(els).forEach(el => {
2233 const n = el.gridstackNode;
2234 if (!n) return;
2235 val ? delete n.noMove : n.noMove = true;
2236 this.prepareDragDrop(n.el); // init DD if need be, and adjust
2237 });
2238 return this;
2239 }
2240
2241 /**
2242 * Enables/Disables user resizing for specific grid elements.

Callers

nothing calls this directly

Calls 2

prepareDragDropMethod · 0.95
getElementsMethod · 0.45

Tested by

no test coverage detected