Options
All
  • Public
  • Public/Protected
  • All
Menu

DrawGrid

classdesc

cheetahGrid.core.DrawGrid

memberof

cheetahGrid.core

Hierarchy

Implements

Index

Constructors

constructor

  • new DrawGrid(options?: DrawGridConstructorOptions): DrawGrid
  • Parameters

    • options: DrawGridConstructorOptions = {}

    Returns DrawGrid

Accessors

canvas

  • get canvas(): HTMLCanvasElement

colCount

  • get colCount(): number
  • set colCount(colCount: number): void

defaultColWidth

  • get defaultColWidth(): string | number
  • set defaultColWidth(defaultColWidth: string | number): void

defaultRowHeight

  • get defaultRowHeight(): number
  • set defaultRowHeight(defaultRowHeight: number): void

font

  • get font(): undefined | string
  • set font(font: undefined | string): void
  • Get the font definition as a string.

    Returns undefined | string

  • Set the font definition with the given string.

    Parameters

    • font: undefined | string

    Returns void

frozenColCount

  • get frozenColCount(): number
  • set frozenColCount(frozenColCount: number): void

frozenRowCount

  • get frozenRowCount(): number
  • set frozenRowCount(frozenRowCount: number): void

keyboardOptions

leftCol

  • get leftCol(): number
  • Get the index of the first column in the scrollable region that is visible.

    Returns number

rowCount

  • get rowCount(): number
  • set rowCount(rowCount: number): void

scrollLeft

  • get scrollLeft(): number
  • set scrollLeft(scrollLeft: number): void
  • gets or sets the number of pixels that an element's content is scrolled from its left edge

    Returns number

  • gets or sets the number of pixels that an element's content is scrolled from its left edge

    Parameters

    • scrollLeft: number

    Returns void

scrollTop

  • get scrollTop(): number
  • set scrollTop(scrollTop: number): void
  • gets or sets the number of pixels that an element's content is scrolled vertically

    Returns number

  • gets or sets the number of pixels that an element's content is scrolled vertically

    Parameters

    • scrollTop: number

    Returns void

selection

  • get selection(): Selection

topRow

  • get topRow(): number
  • Get the index of the first row in the scrollable region that is visible.

    Returns number

trimOnPaste

  • get trimOnPaste(): boolean
  • set trimOnPaste(trimOnPaste: boolean): void
  • If set to true, trim the pasted text on pasting.

    Returns boolean

  • If set to true, trim the pasted text on pasting.

    Parameters

    • trimOnPaste: boolean

    Returns void

underlayBackgroundColor

  • get underlayBackgroundColor(): undefined | string
  • set underlayBackgroundColor(underlayBackgroundColor: undefined | string): void

visibleColCount

  • get visibleColCount(): number
  • Get the number of scrollable columns fully visible in the grid. visibleColCount does not include the frozen columns counted by the frozenColCount property. It does not include any partially visible columns on the right of the grid.

    Returns number

visibleRowCount

  • get visibleRowCount(): number
  • Get the number of scrollable rows fully visible in the grid. visibleRowCount does not include the frozen rows counted by the frozenRowCount property. It does not include any partially visible rows on the bottom of the grid.

    Returns number

Static EVENT_TYPE

  • get EVENT_TYPE(): DrawGridEvents
  • Returns DrawGridEvents

Methods

addDisposable

  • addDisposable(disposable: { dispose: any }): void
  • Parameters

    • disposable: { dispose: any }
      • dispose:function
        • dispose(): void
        • Returns void

    Returns void

addEventListener

  • addEventListener(type: string, listener: AnyFunction): void
  • Parameters

    Returns void

configure

  • configure(name: "fadeinWhenCallbackInPromise", value?: boolean): boolean
  • Parameters

    • name: "fadeinWhenCallbackInPromise"
    • Optional value: boolean

    Returns boolean

dispose

  • dispose(): void
  • Dispose the grid instance.

    Returns void

fireListeners

focus

  • focus(): void

focusCell

  • focusCell(col: number, row: number): void
  • Focus the cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    Returns void

getAttachCellsArea

  • getAttachCellsArea(range: CellRange): { element: HTMLElement; rect: Rect }

getCellAt

  • getCellAt(absoluteX: number, absoluteY: number): CellAddress

getCellOverflowText

  • getCellOverflowText(col: number, row: number): null | string
  • Get the overflowed text in the cell rectangle, from the given cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    Returns null | string

    The text overflowing the cell rect.

getCellRangeRect

getCellRect

  • getCellRect(col: number, row: number): Rect
  • Get the rect of the cell.

    Parameters

    • col: number

      index of column, of the cell

    • row: number

      index of row, of the cell

    Returns Rect

    the rect of the cell.

getCellRelativeRect

  • getCellRelativeRect(col: number, row: number): Rect
  • Get the relative rectangle of the cell.

    Parameters

    • col: number

      index of column, of the cell

    • row: number

      index of row, of the cell

    Returns Rect

    the rect of the cell.

getCellsRect

  • getCellsRect(startCol: number, startRow: number, endCol: number, endRow: number): Rect
  • Get the rectangle of the cells area.

    Parameters

    • startCol: number

      index of the starting column, of the cell

    • startRow: number

      index of the starting row, of the cell

    • endCol: number

      index of the ending column, of the cell

    • endRow: number

      index of the ending row, of the cell

    Returns Rect

    the rect of the cells.

getColAt

  • getColAt(absoluteX: number): number

getColWidth

  • getColWidth(col: number): number
  • Get the column width of the given the column index.

    Parameters

    • col: number

      The column index

    Returns number

    The column width

getElement

  • getElement(): HTMLElement

getMaxColWidth

  • getMaxColWidth(col: number): undefined | string | number
  • Get the column max width of the given the column index.

    Parameters

    • col: number

      The column index

    Returns undefined | string | number

    The column max width

getMinColWidth

  • getMinColWidth(col: number): undefined | string | number
  • Get the column min width of the given the column index.

    Parameters

    • col: number

      The column index

    Returns undefined | string | number

    The column min width

getRowAt

  • getRowAt(absoluteY: number): number

getRowHeight

  • getRowHeight(row: number): number
  • Get the row height of the given the row index.

    Parameters

    • row: number

      The row index

    Returns number

    The row height

hasFocusGrid

  • hasFocusGrid(): boolean

hasListeners

  • hasListeners(type: string): boolean
  • Parameters

    • type: string

    Returns boolean

invalidate

  • invalidate(): void

invalidateCell

  • invalidateCell(col: number, row: number): void
  • Redraws the range of the given cell.

    Parameters

    • col: number

      The column index of cell.

    • row: number

      The row index of cell.

    Returns void

invalidateCellRange

invalidateGridRect

  • invalidateGridRect(startCol: number, startRow: number, endCol?: number, endRow?: number): void
  • Redraws the range of the given cells.

    Parameters

    • startCol: number

      index of the starting column, of the cell

    • startRow: number

      index of the starting row, of the cell

    • endCol: number = startCol

      index of the ending column, of the cell

    • endRow: number = startRow

      index of the ending row, of the cell

    Returns void

isFrozenCell

  • isFrozenCell(col: number, row: number): null | { col: boolean; row: boolean }
  • Parameters

    • col: number
    • row: number

    Returns null | { col: boolean; row: boolean }

listen

  • Adds an event listener.

    Parameters

    • type: string

      The event type id.

    • listener: AnyFunction

      Callback method.

    Returns number

    unique id for the listener.

makeVisibleCell

  • makeVisibleCell(col: number, row: number): void
  • Scroll to where cell is visible.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    Returns void

onKeyDownMove

  • onKeyDownMove(evt: KeyboardEvent): void

removeEventListener

  • removeEventListener(type: string, listener: AnyFunction): void
  • Parameters

    Returns void

setCellOverflowText

  • setCellOverflowText(col: number, row: number, overflowText: string | false): void
  • Set the overflowed text in the cell rectangle, to the given cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    • overflowText: string | false

      The overflowed text in the cell rectangle.

    Returns void

setColWidth

  • setColWidth(col: number, width: null | string | number): void
  • Set the column width of the given the column index.

    Parameters

    • col: number

      The column index

    • width: null | string | number

      The column width

    Returns void

setFocusCursor

  • setFocusCursor(col: number, row: number): void
  • Moves the focus cursor to the given cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    Returns void

setMaxColWidth

  • setMaxColWidth(col: number, maxwidth: null | string | number): void
  • Set the column max width of the given the column index.

    Parameters

    • col: number

      The column index

    • maxwidth: null | string | number

      The column max width

    Returns void

setMinColWidth

  • setMinColWidth(col: number, minwidth: null | string | number): void
  • Set the column min width of the given the column index.

    Parameters

    • col: number

      The column index

    • minwidth: null | string | number

      The column min width

    Returns void

setRowHeight

  • setRowHeight(row: number, height: null | number): void
  • Set the row height of the given the row index.

    Parameters

    • row: number

      The row index

    • height: null | number

      The row height

    Returns void

unlisten

  • unlisten(id: number): void
  • Removes an event listener which was added with listen() by the id returned by listen().

    Parameters

    • id: number

      the id returned by listen().

    Returns void

updateScroll

  • updateScroll(): boolean
  • Apply the changed scroll size.

    Returns boolean

    true if there was a change in the scroll size

updateSize

  • updateSize(): void

Generated using TypeDoc