Interface GridElement

Type returned via ref property

interface GridElement {
    cellLayout: CellLayout;
    columnCount: number;
    getCoordsAsRange: ((coords) => CellRangeCoords);
    getDimensions: (() => {
        containerHeight: number;
        containerWidth: number;
        totalHeight: number;
        totalWidth: number;
    });
    getRelativePointFromOffset: ((x, y) => Point);
    getScrollPosition: (() => TopLeft);
    getViewFromCoords: ((coords) => GridOverlayView);
    getViewFromLocation: ((anchor) => GridOverlayView);
    getViewFromOffset: ((x, y) => GridOverlayView);
    getViewport: (() => CellRangeCoords);
    handleWheel: ((event) => void);
    invalidate: ((coords?) => void);
    onViewChangeOnce: ((callback) => void);
    rowCount: number;
    scrollCellIntoView: ((coords, options?) => Promise<Partial<TopLeft>>);
    stage: HTMLDivElement;
}

Hierarchy (view full)

Properties

cellLayout: CellLayout

The cellLayout without any offset or view specific adjustments.

columnCount: number

The columnCount provided by the properties

getCoordsAsRange: ((coords) => CellRangeCoords)

Return the cell as a range. If this cell is merged this will be reflected. Note - This is slightly more sophisticated than rowSpan and colSpan because it allows for queries that are not on the top/left

Type declaration

getDimensions: (() => {
    containerHeight: number;
    containerWidth: number;
    totalHeight: number;
    totalWidth: number;
})

Type declaration

    • (): {
          containerHeight: number;
          containerWidth: number;
          totalHeight: number;
          totalWidth: number;
      }
    • Returns {
          containerHeight: number;
          containerWidth: number;
          totalHeight: number;
          totalWidth: number;
      }

      • containerHeight: number
      • containerWidth: number
      • totalHeight: number
      • totalWidth: number
getRelativePointFromOffset: ((x, y) => Point)

The grid coordinates relative to the containing div (includes any padding, margins)

Type declaration

    • (x, y): Point
    • Parameters

      • x: number
      • y: number

      Returns Point

getScrollPosition: (() => TopLeft)

Type declaration

getViewFromCoords: ((coords) => GridOverlayView)

Return the view for the given coords. If coord is over a frozen pane it will return the frozen pane otherwise it will return the center view. This will never return null.

Type declaration

getViewFromLocation: ((anchor) => GridOverlayView)

Return null if the view does not exist.

Type declaration

getViewFromOffset: ((x, y) => GridOverlayView)

Return the view for the given point. If point is over a frozen pane it will return the frozen pane otherwise it will return the center view. This will never return null.

Type declaration

getViewport: (() => CellRangeCoords)

Type declaration

handleWheel: ((event) => void)

Type declaration

    • (event): void
    • Parameters

      • event: WheelEvent

      Returns void

invalidate: ((coords?) => void)

Invalidate either a cell or a range of cells. If no arguments are provided then the entire grid is invalidated.

Type declaration

onViewChangeOnce: ((callback) => void)

Called when the view has been changed.

Type declaration

    • (callback): void
    • Parameters

      • callback: (() => void)
          • (): void
          • Returns void

      Returns void

Remarks

This is only called once.

rowCount: number

The rowCount provided by the properties

scrollCellIntoView: ((coords, options?) => Promise<Partial<TopLeft>>)

Scroll the cell into view. If the coord does not have an index it will only scroll in a single direction.

Type declaration

    • (coords, options?): Promise<Partial<TopLeft>>
    • Parameters

      • coords: Partial<CellCoords>
      • Optional options: boolean | ScrollIntoViewOptions

      Returns Promise<Partial<TopLeft>>

stage: HTMLDivElement

The stage element for the cells