Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ListGrid<T>

ListGrid

classdesc

cheetahGrid.ListGrid

memberof

cheetahGrid

Type parameters

  • T

Hierarchy

Implements

Index

Constructors

constructor

Properties

disabled

disabled: boolean = false

readOnly

readOnly: boolean = false

Accessors

allowRangePaste

  • get allowRangePaste(): boolean
  • set allowRangePaste(allowRangePaste: boolean): void
  • If set to true to allow pasting of ranges.

    Returns boolean

  • If set to true to allow pasting of ranges.

    Parameters

    • allowRangePaste: boolean

    Returns void

canvas

  • get canvas(): HTMLCanvasElement
  • Get canvas element.

    Returns HTMLCanvasElement

colCount

  • get colCount(): number
  • set colCount(colCount: number): void
  • Get the number of columns.

    Returns number

  • Set the number of columns.

    Parameters

    • colCount: number

    Returns void

dataSource

  • Get the data source.

    Returns DataSource<T>

  • Set the data source from given

    Parameters

    Returns void

defaultColWidth

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

defaultRowHeight

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

font

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

    override

    Returns string

  • Set the font definition with the given string.

    override

    Parameters

    • font: string

    Returns void

frozenColCount

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

frozenRowCount

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

header

  • Gets the define of the header.

    multiline header

    caption: header caption columns: columns define


    Returns HeadersDefine<T>

  • Sets the define of the header with the given data.

    column options
    -----
    caption: header caption
    field: field name
    width: column width
    minWidth: column min width
    maxWidth: column max width
    icon: icon name
    message: message key name
    columnType: column type
    action: column action
    style: column style
    headerType: header type
    headerStyle: header style
    headerAction: header action
    headerField: header field name
    sort: define sort setting
    -----
                    

    multiline header

    caption: header caption columns: columns define


    Parameters

    Returns void

headerValues

  • get headerValues(): HeaderValues
  • set headerValues(headerValues: Map<any, any>): void
  • Get the header values.

    Returns HeaderValues

  • Sets the header values.

    Parameters

    • headerValues: Map<any, any>

    Returns void

keyboardOptions

layout

leftCol

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

    Returns number

recordRowCount

  • get recordRowCount(): number
  • Get the row count per record

    Returns number

records

  • get records(): T[] | null
  • set records(records: null | T[]): void
  • Get the records.

    Returns T[] | null

  • Set the records from given

    Parameters

    • records: null | T[]

    Returns void

rowCount

  • get rowCount(): number
  • set rowCount(rowCount: number): void
  • Get the number of rows.

    Returns number

  • Set the number of rows.

    Parameters

    • rowCount: number

    Returns 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

sortState

  • Get the sort state.

    Returns SortState

  • Sets the sort state. If null to set, the sort state is initialized.

    Parameters

    Returns void

theme

  • get theme(): Theme | null
  • set theme(theme: null | Theme): void
  • Get the theme.

    Returns Theme | null

  • Set the theme from given

    Parameters

    • theme: null | Theme

    Returns void

topRow

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

    Returns number

underlayBackgroundColor

  • get underlayBackgroundColor(): string
  • set underlayBackgroundColor(underlayBackgroundColor: 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(): typeof LG_EVENT_TYPE

Methods

addDisposable

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

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

    Returns void

addEventListener

  • addEventListener(type: string, listener: AnyListener): void

configure

  • configure(name: "fadeinWhenCallbackInPromise", value?: undefined | false | true): boolean

dispose

  • dispose(): void

doChangeValue

  • doChangeValue(col: number, row: number, changeValueCallback: (before: any) => any): MaybePromise<boolean>
  • Parameters

    • col: number
    • row: number
    • changeValueCallback: (before: any) => any
        • (before: any): any
        • Parameters

          • before: any

          Returns any

    Returns MaybePromise<boolean>

doGetCellValue

  • doGetCellValue(col: number, row: number, valueCallback: (value: any) => void): boolean
  • Parameters

    • col: number
    • row: number
    • valueCallback: (value: any) => void
        • (value: any): void
        • Parameters

          • value: any

          Returns void

    Returns boolean

doSetPasteValue

  • Parameters

    Returns void

fireListeners

  • fireListeners<TYPE>(type: TYPE, ...event: ListGridEventHandlersEventMap<T>[TYPE]): ListGridEventHandlersReturnMap[TYPE][]

focus

  • focus(): void

focusCell

  • focusCell(col: number, row: number): void

focusGridCell

  • focusGridCell(field: FieldDef<T>, index: number): void

getAttachCellsArea

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

getCellAt

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

getCellOverflowText

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

    Parameters

    • col: number

      The column index.

    • row: number

      The row index

    Returns string | null

    The text overflowing the cell rect.

getCellRange

  • getCellRange(col: number, row: number): CellRange
  • Get cell range information for a given cell.

    Parameters

    • col: number

      column index of the cell

    • row: number

      row index of the cell

    Returns CellRange

    cell range info

getCellRangeByField

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

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

getColumnDefine

  • getColumnDefine(col: number, row: number): ColumnDefine<T>
  • Get the column define of the given column index.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index.

    Returns ColumnDefine<T>

    The column define object.

getColumnIndexByField

  • getColumnIndexByField(field: FieldDef<T>): number | null
  • Get the column index of the given field.

    deprecated

    use getCellRangeByField instead

    Parameters

    Returns number | null

    The column index.

getColumnType

getElement

  • getElement(): HTMLElement

getField

  • getField(col: number, row: number): FieldDef<T> | undefined
  • Get the field of the given column index.

    Parameters

    • col: number

      The column index.

    • row: number

      The row index.

    Returns FieldDef<T> | undefined

    The field object.

getGridCanvasHelper

  • getGridCanvasHelper(): GridCanvasHelper<T>

getHeaderCellRange

  • getHeaderCellRange(col: number, row: number): CellRange
  • Get header range information for a given cell.

    deprecated

    use getCellRange instead

    Parameters

    • col: number

      column index of the cell

    • row: number

      row index of the cell

    Returns CellRange

    cell range info

getHeaderDefine

  • getHeaderDefine(col: number, row: number): HeaderDefine<T>
  • Get the header define of the given header cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The header row index.

    Returns HeaderDefine<T>

    The header define object.

getHeaderField

  • getHeaderField(col: number, row: number): any | undefined
  • Get the header field of the given header cell.

    Parameters

    • col: number

      The column index.

    • row: number

      The header row index.

    Returns any | undefined

    The field object.

getHeaderValue

  • getHeaderValue(col: number, row: number): any | undefined

getLayoutCellId

getMaxColWidth

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

    Parameters

    • col: number

      The column index

    Returns string | number | undefined

    The column max width

getMinColWidth

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

    Parameters

    • col: number

      The column index

    Returns string | number | undefined

    The column min width

getRecordIndexByRow

  • getRecordIndexByRow(row: number): number

getRecordStartRowByRecordIndex

  • getRecordStartRowByRecordIndex(index: number): number

getRowAt

  • getRowAt(absoluteY: number): number

getRowHeight

  • getRowHeight(row: number): number

getRowRecord

hasFocusGrid

  • hasFocusGrid(): boolean

hasListeners

  • hasListeners(type: string): boolean

invalidate

  • invalidate(): void

invalidateCell

  • invalidateCell(col: number, row: number): void

invalidateCellRange

  • invalidateCellRange(range: CellRange): void

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

    • Default value endCol: number = startCol

      index of the ending column, of the cell

    • Default value endRow: number = startRow

      index of the ending row, of the cell

    Returns void

isFrozenCell

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

listen

makeVisibleCell

  • makeVisibleCell(col: number, row: number): void

makeVisibleGridCell

  • makeVisibleGridCell(field: FieldDef<T>, index: number): void

onKeyDownMove

  • onKeyDownMove(evt: KeyboardEvent): void

removeEventListener

  • removeEventListener(type: string, listener: AnyListener): 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: string | number): void
  • Set the column widtht of the given the column index.

    Parameters

    • col: number

      The column index

    • width: string | number

      The column width

    Returns void

setFocusCursor

  • setFocusCursor(col: number, row: number): void

setHeaderValue

  • setHeaderValue(col: number, row: number, newValue: any): void

setMaxColWidth

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

    Parameters

    • col: number

      The column index

    • maxwidth: string | number

      The column max width

    Returns void

setMinColWidth

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

    Parameters

    • col: number

      The column index

    • minwidth: string | number

      The column min width

    Returns void

setRowHeight

  • setRowHeight(row: number, height: number): void

unlisten

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

    Parameters

    Returns void

updateScroll

  • updateScroll(): boolean

updateSize

  • updateSize(): void

Generated using TypeDoc