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

Method cellWidth

src/gridstack.ts:950–952  ·  view source on GitHub ↗

* Gets the current cell width in pixels. This is calculated based on the grid container width divided by the number of columns. * * @returns the cell width in pixels * * @example * const width = grid.cellWidth(); * console.log('Cell width:', width, 'px'); * * // Use cell widt

()

Source from the content-addressed store, hash-verified

948 * const widgetWidth = width * 3; // For a 3-column wide widget
949 */
950 public cellWidth(): number {
951 return this._widthOrContainer() / this.getColumn();
952 }
953
954 /** return our expected width (or parent) , and optionally of window for dynamic column check */
955 protected _widthOrContainer(forBreakpoint = false): number {

Callers 6

cellHeightMethod · 0.95
rotateMethod · 0.95
_setupAcceptWidgetMethod · 0.95
onStartMovingMethod · 0.95
gridstack-spec.tsFile · 0.80

Calls 2

_widthOrContainerMethod · 0.95
getColumnMethod · 0.95

Tested by

no test coverage detected