Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Grid<Data, RowProps, Key>

Type parameters

  • Data = any

  • RowProps = Record<string, unknown>

  • Key = string

Hierarchy

Index

Constructors

constructor

  • new Grid<Data, RowProps, Key>(props: IGridProps<Data, RowProps, Key>): Grid<Data, RowProps, Key>
  • Type parameters

    • Data = any

    • RowProps = Record<string, unknown>

    • Key = string

    Parameters

    Returns Grid<Data, RowProps, Key>

Properties

bodyTable

bodyTable: RefObject<HTMLDivElement> = ...

context

context: any

If using the new style context, re-declare this in your class to be the React.ContextType of your static contextType. Should be used with type annotation or static contextType.

static contextType = MyContext
// For TS pre-3.7:
context!: React.ContextType<typeof MyContext>
// For TS 3.7 and above:
declare context: React.ContextType<typeof MyContext>
see

https://reactjs.org/docs/context.html

footEl

footEl: Element

footNode

footNode: RefObject<Footer> = ...

getExpandBodyRender

getExpandBodyRender: (expandRowKeys: boolean[], expandation: IGridExpandation<any>) => IGridColumnBodyRenderFunc<Data> = ...

Type declaration

gridNode

gridNode: RefObject<HTMLDivElement> = ...

handleBatchSelect

handleBatchSelect: (type: "selectAll" | "removeAll", datasets: readonly Data[]) => void = ...

Type declaration

    • (type: "selectAll" | "removeAll", datasets: readonly Data[]): void
    • Parameters

      • type: "selectAll" | "removeAll"
      • datasets: readonly Data[]

      Returns void

handleBodyScrollRunOnceNextFrame

handleBodyScrollRunOnceNextFrame: (e: UIEvent<HTMLDivElement, UIEvent>) => void & ICancelable = ...

headerEl

headerEl: Element

headerNode

headerNode: RefObject<Header<Data>> = ...

isAnyColumnsFixed

isAnyColumnsFixed: () => boolean = ...

Type declaration

    • (): boolean
    • Returns boolean

isAnyColumnsLeftFixed

isAnyColumnsLeftFixed: () => boolean = ...

Type declaration

    • (): boolean
    • Returns boolean

isAnyColumnsRightFixed

isAnyColumnsRightFixed: () => boolean = ...

Type declaration

    • (): boolean
    • Returns boolean

lastScrollLeft

lastScrollLeft: number

lastScrollTop

lastScrollTop: number

leftBody

leftBody: RefObject<HTMLDivElement> = ...

mounted

mounted: boolean = false

Readonly props

props: Readonly<IGridProps<Data, RowProps, Key>> & Readonly<{ children?: ReactNode }>

refs

refs: {}

Type declaration

  • [key: string]: ReactInstance

renderSelectionCheckbox

renderSelectionCheckbox: () => IGridColumnBodyRenderFunc<Data> = ...

Type declaration

renderSelectionRadio

renderSelectionRadio: () => IGridColumnBodyRenderFunc<Data> = ...

Type declaration

rightBody

rightBody: RefObject<HTMLDivElement> = ...

scrollBody

scrollBody: RefObject<HTMLDivElement> = ...

scrollHeader

scrollHeader: RefObject<HTMLDivElement> = ...

scrollPosition

scrollPosition: GridScrollPosition

selectionPropsCache

selectionPropsCache: {} = {}

Type declaration

  • [key: string]: { disabled?: boolean; reason?: React.ReactNode }
    • Optional disabled?: boolean
    • Optional reason?: React.ReactNode

state

state: Readonly<IGridState>

stickyHead

stickyHead: RefObject<HTMLDivElement> = ...

store

store: default = ...

Static Optional contextType

contextType: Context<any>

If set, this.context will be set at runtime to the current value of the given Context.

Usage:

type MyContext = number
const Ctx = React.createContext<MyContext>(0)

class Foo extends React.Component {
  static contextType = Ctx
  context!: React.ContextType<typeof Ctx>
  render () {
    return <>My context's value: {this.context}</>;
  }
}
see

https://reactjs.org/docs/context.html#classcontexttype

Static defaultProps

defaultProps: Partial<IGridProps<any, {}, string>> = ...

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<IGridProps<Data, RowProps, Key>>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<IGridProps<Data, RowProps, Key>>, nextState: Readonly<IGridState>, nextContext: any): void

Optional componentDidCatch

  • componentDidCatch(error: Error, errorInfo: ErrorInfo): void
  • Catches exceptions generated in descendant components. Unhandled exceptions will cause the entire component tree to unmount.

    Parameters

    • error: Error
    • errorInfo: ErrorInfo

    Returns void

componentDidMount

  • componentDidMount(): void

componentDidUpdate

  • componentDidUpdate(prevProps: any): void

Optional componentWillMount

  • componentWillMount(): void

componentWillReceiveProps

  • componentWillReceiveProps(nextProps: IGridProps<Data, RowProps, Key>): void

componentWillUnmount

  • componentWillUnmount(): void

Optional componentWillUpdate

  • componentWillUpdate(nextProps: Readonly<IGridProps<Data, RowProps, Key>>, nextState: Readonly<IGridState>, nextContext: any): void

forceScroll

  • forceScroll(target: EventTarget, distance: number, direction: "Left" | "Top"): void

forceUpdate

  • forceUpdate(callback?: () => void): void
  • Parameters

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

    Returns void

getBatchComponents

  • getBatchComponents(position: "header" | "foot"): Element

getBatchFixedStyle

  • getBatchFixedStyle(): { width: undefined } | { width: number }

getColumns

getDataKey

  • getDataKey(data: Data, rowIndex: string | number): any

getEmpty

getExpandRowKeys

  • getExpandRowKeys(props: IGridProps<Data, RowProps, Key>): boolean[]

getLeftColumns

  • getLeftColumns(): any

getLeftFixedTable

  • getLeftFixedTable(): Element[]

getRightColumns

  • getRightColumns(): any

getRightFixedTable

  • getRightFixedTable(): Element[]

getSelectionColumn

getSelectionPropsByItem

  • getSelectionPropsByItem(data: Data, rowIndex: string | number, nextSelection?: IGridSelection<Data, Key>): { disabled?: boolean; reason?: ReactNode }
  • Parameters

    • data: Data
    • rowIndex: string | number
    • Optional nextSelection: IGridSelection<Data, Key>

    Returns { disabled?: boolean; reason?: ReactNode }

    • Optional disabled?: boolean
    • Optional reason?: ReactNode

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<IGridProps<Data, RowProps, Key>>, prevState: Readonly<IGridState>): any
  • Runs before React applies the result of render to the document, and returns an object to be given to componentDidUpdate. Useful for saving things such as scroll position before render causes changes to it.

    Note: the presence of getSnapshotBeforeUpdate prevents any of the deprecated lifecycle events from running.

    Parameters

    Returns any

getStickyHead

  • getStickyHead(): Element

getTable

  • getTable(options?: { bodyRef?: RefObject<HTMLDivElement>; columns?: IGridInnerColumn<Data>[]; fixed?: IGridInnerFixedType; headRef?: RefObject<HTMLDivElement>; isStickyHead?: boolean }): Element[]

handleBodyScroll

  • handleBodyScroll(e: UIEvent<HTMLDivElement, UIEvent>): void

handleExpandRow

  • handleExpandRow(clickRow: number, rowData: Data): (e: MouseEvent<HTMLSpanElement, MouseEvent>) => void
  • Parameters

    • clickRow: number
    • rowData: Data

    Returns (e: MouseEvent<HTMLSpanElement, MouseEvent>) => void

      • (e: MouseEvent<HTMLSpanElement, MouseEvent>): void
      • Parameters

        • e: MouseEvent<HTMLSpanElement, MouseEvent>

        Returns void

handleSelect

isFixedLayout

  • isFixedLayout(): boolean

onChange

onPaginationChange

  • onPaginationChange(pageSize: number, current: number): void

onResize

  • onResize(): void

onRowMouseEnter

  • onRowMouseEnter(mouseOverRowIndex: number): void

onScroll

  • onScroll(): void

onSelectChange

  • onSelectChange(selectedRowKeys: Key[], data: Data | Data[]): void

render

  • render(): Element

setScrollPosition

setScrollPositionClassName

  • setScrollPositionClassName(): void

setState

  • Type parameters

    Parameters

    Returns void

setStickyHeadWidth

  • setStickyHeadWidth(): void

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<IGridProps<Data, RowProps, Key>>, nextState: Readonly<IGridState>, nextContext: any): boolean
  • Called to determine whether the change in props and state should trigger a re-render.

    Component always returns true. PureComponent implements a shallow comparison on props and state and returns true if any props or states have changed.

    If false is returned, Component#render, componentWillUpdate and componentDidUpdate will not be called.

    Parameters

    • nextProps: Readonly<IGridProps<Data, RowProps, Key>>
    • nextState: Readonly<IGridState>
    • nextContext: any

    Returns boolean

syncFixedTableRowHeight

  • syncFixedTableRowHeight(): void

toggleBatchComponents

  • toggleBatchComponents(): void

Generated using TypeDoc