Options
All
  • Public
  • Public/Protected
  • All
Menu

The properties that will be passed to the DataEditor component or function.

Type parameters

  • T

  • V

Hierarchy

  • DataEditorProps

Index

Properties

cell

cell: T

The cell's raw data structure

col

col: number

The current column index

onChange

onChange: function

A callback for when the user changes the value during editing (for example, each time they type a character into an input). onChange does not indicate the final edited value. It works just like a controlled component in a form.

Type declaration

    • (newValue: V): void
    • Parameters

      • newValue: V

      Returns void

onCommit

onCommit: function

function (newValue, [event]) {} A callback to indicate that editing is over, here is the final value. If you pass a KeyboardEvent as the second argument, React-DataSheet will perform default navigation for you (for example, going down to the next row if you hit the enter key). You actually don't need to use onCommit if the default keyboard handling is good enough for you.

Type declaration

    • (newValue: V, event: KeyboardEvent<HTMLElement>): void
    • Parameters

      • newValue: V
      • event: KeyboardEvent<HTMLElement>

      Returns void

onKeyDown

onKeyDown: React.KeyboardEventHandler<HTMLElement>

An event handler that you can call to use default React-DataSheet keyboard handling to signal reverting an ongoing edit (Escape key) or completing an edit (Enter or Tab). For most editors based on an input element this will probably work. However, if this keyboard handling is unsuitable for your editor you can trigger these changes explicitly using the onCommit and onRevert callbacks.

onRevert

onRevert: function

function () {} A no-args callback that you can use to indicate that you want to cancel ongoing edits. As with onCommit, you don't need to worry about this if the default keyboard handling works for your editor.

Type declaration

    • (): void
    • Returns void

row

row: number

The current row index

value

value: string | number | null

The result of the dataRenderer (or valueRenderer if none)

Generated using TypeDoc