Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

  • SS

Hierarchy

Index

Type aliases

Static AttributesRenderer

AttributesRenderer: function

A function to add attributes to the rendered cell element. It should return an object with properties corresponding to the name and vales of the attributes you wish to add. To wire it up, pass your function to the attributesRenderer property of the ReactDataSheet component.

Type declaration

    • (cell: T, row: number, col: number): __type
    • Parameters

      • cell: T
      • row: number
      • col: number

      Returns __type

Static CellAdditionsArgs

CellAdditionsArgs: object[]

The arguments that will be passed to the second parameter of the onCellsChanged handler function. These represent all the changes outside the bounds of the existing grid. The generic parameter (default: string) indicates the type of the value property.

Static CellRenderer

CellRenderer: ComponentClass<CellRendererProps<T, V>> | React.SFC<CellRendererProps<T, V>>

A function or React Component to render each cell element. The default renders a td element. To wire it up, pass it to the cellRenderer property of the ReactDataSheet component.

Static CellsChangedArgs

CellsChangedArgs: object[]

The arguments that will be passed to the first parameter of the onCellsChanged handler function. These represent all the changes inside the bounds of the existing grid. The first generic parameter (required) indicates the type of the cell property, and the second generic parameter (default: string) indicates the type of the value property.

Static CellsChangedHandler

CellsChangedHandler: function

onCellsChanged handler: function(arrayOfChanges[, arrayOfAdditions]) {}, where changes is an array of objects of the shape {cell, row, col, value}. To wire it up, pass your function to the onCellsChanged property of the ReactDataSheet component.

Type declaration

Static ContextMenuHandler

ContextMenuHandler: function

Context menu handler : function(event, cell, i, j). To wire it up, pass your function to the onContextMenu property of the ReactDataSheet component.

Type declaration

    • (event: MouseEvent, cell: T, row: number, col: number): void
    • Parameters

      • event: MouseEvent
      • cell: T
      • row: number
      • col: number

      Returns void

Static DataEditor

DataEditor: ComponentClass<DataEditorProps<T, V>> | React.SFC<DataEditorProps<T, V>>

A function or React Component to render a custom editor. If it is passed to the dataEditor property of the ReactDataSheet component, it affects every cell in the sheet. Different editors can also be passed to the dataEditor property of each Cell to control each cell separately.

Static DataRenderer

DataRenderer: function

A function to render the underlying value of the cell. This data is visible once in edit mode. To wire it up, pass your function to the dataRenderer property of the ReactDataSheet component.

Type declaration

    • (cell: T, row: number, col: number): string | number | null | void
    • Parameters

      • cell: T
      • row: number
      • col: number

      Returns string | number | null | void

Static PasteParser

PasteParser: function

A function to process the raw clipboard data. It should return an array of arrays of strings. This is useful for when the clipboard may have data with irregular field or line delimiters. If not set, rows will be split with line breaks and cells with tabs. To wire it up pass your function to the parsePaste property of the ReactDataSheet component.

Type declaration

    • (pastedString: string): string[][]
    • Parameters

      • pastedString: string

      Returns string[][]

Static RowRenderer

RowRenderer: ComponentClass<RowRendererProps<T, V>> | React.SFC<RowRendererProps<T, V>>

Optional function or React Component to render each row element. The default renders a tr element. To wire it up, pass your function to the rowRenderer property of the ReactDataSheet component.

Static SheetRenderer

SheetRenderer: ComponentClass<SheetRendererProps<T, V>> | React.SFC<SheetRendererProps<T, V>>

Optional function or React Component to render the main sheet element. The default renders a table element. To wire it up, pass your function to the sheetRenderer property of the ReactDataSheet component.

Static ValueRenderer

ValueRenderer: function

A function to render the value of the cell function(cell, i, j). This is visible by default. To wire it up, pass your function to the valueRenderer property of the ReactDataSheet component.

Type declaration

    • (cell: T, row: number, col: number): string | number | null | void
    • Parameters

      • cell: T
      • row: number
      • col: number

      Returns string | number | null | void

Static ValueViewer

ValueViewer: ComponentClass<ValueViewerProps<T, V>> | React.SFC<ValueViewerProps<T, V>>

Optional function or React Component to customize the way the value for each cell in the sheet is displayed. If it is passed to the valueViewer property of the ReactDataSheet component, it affects every cell in the sheet. Different editors can also be passed to the valueViewer property of each Cell to control each cell separately.

Properties

getSelectedCells

getSelectedCells: function

Type declaration

    • (data: GridElement[][], start: CellReference, end: CellReference): object
    • Parameters

      • data: GridElement[][]
      • start: CellReference
      • end: CellReference

      Returns object

Methods

Optional UNSAFE_componentWillMount

  • UNSAFE_componentWillMount(): void

Optional UNSAFE_componentWillReceiveProps

  • UNSAFE_componentWillReceiveProps(nextProps: Readonly<DataSheetProps<GridElement, number>>, nextContext: any): void

Optional UNSAFE_componentWillUpdate

  • UNSAFE_componentWillUpdate(nextProps: Readonly<DataSheetProps<GridElement, number>>, nextState: Readonly<DataSheetState>, 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

Optional componentDidMount

  • componentDidMount(): void
  • Called immediately after a component is mounted. Setting state here will trigger re-rendering.

    Returns void

Optional componentDidUpdate

  • componentDidUpdate(prevProps: Readonly<DataSheetProps<GridElement, number>>, prevState: Readonly<DataSheetState>, snapshot?: SS): void
  • Called immediately after updating occurs. Not called for the initial render.

    The snapshot is only present if getSnapshotBeforeUpdate is present and returns non-null.

    Parameters

    • prevProps: Readonly<DataSheetProps<GridElement, number>>
    • prevState: Readonly<DataSheetState>
    • Optional snapshot: SS

    Returns void

Optional componentWillMount

  • componentWillMount(): void

Optional componentWillReceiveProps

  • componentWillReceiveProps(nextProps: Readonly<DataSheetProps<GridElement, number>>, nextContext: any): void

Optional componentWillUnmount

  • componentWillUnmount(): void
  • Called immediately before a component is destroyed. Perform any necessary cleanup in this method, such as cancelled network requests, or cleaning up any DOM elements created in componentDidMount.

    Returns void

Optional componentWillUpdate

  • componentWillUpdate(nextProps: Readonly<DataSheetProps<GridElement, number>>, nextState: Readonly<DataSheetState>, nextContext: any): void

Optional getSnapshotBeforeUpdate

  • getSnapshotBeforeUpdate(prevProps: Readonly<DataSheetProps<GridElement, number>>, prevState: Readonly<DataSheetState>): SS | null
  • 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

    • prevProps: Readonly<DataSheetProps<GridElement, number>>
    • prevState: Readonly<DataSheetState>

    Returns SS | null

Optional shouldComponentUpdate

  • shouldComponentUpdate(nextProps: Readonly<DataSheetProps<GridElement, number>>, nextState: Readonly<DataSheetState>, 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<DataSheetProps<GridElement, number>>
    • nextState: Readonly<DataSheetState>
    • nextContext: any

    Returns boolean

Generated using TypeDoc