DataEditor
Basic Usage
HTML/CSS Prerequisites
<div id="portal" style="position: fixed; left: 0; top: 0; z-index: 9999;" /><DataEditor width={500} height={300} {...props} />Changes to your data
Definition
interface DataEditorProps {
allowedFillDirections?: "horizontal" | "vertical" | "orthogonal" | "any",
className?: string;
coercePasteValue?: ((val, cell) => undefined | GridCell);
columnSelect?: "none" | "single" | "multi";
columnSelectionBlending?: SelectionBlending;
columns: readonly GridColumn[];
copyHeaders?: boolean;
customRenderers?: readonly CustomRenderer<any>[];
drawCell?: DrawCellCallback;
drawFocusRing?: boolean;
drawHeader?: DrawHeaderCallback;
experimental?: {
disableAccessibilityTree?: boolean;
disableMinimumCellWidth?: boolean;
enableFirefoxRescaling?: boolean;
hyperWrapping?: boolean;
isSubGrid?: boolean;
kineticScrollPerfHack?: boolean;
paddingBottom?: number;
paddingRight?: number;
renderStrategy?: "single-buffer" | "double-buffer" | "direct";
scrollbarWidthOverride?: number;
strict?: boolean;
};
fillHandle?: boolean;
fixedShadowX?: boolean;
fixedShadowY?: boolean;
freezeColumns?: number;
freezeTrailingRows?: number;
getCellContent: ((cell) => GridCell);
getCellsForSelection?: true | ((selection, abortSignal) => GetCellsThunk | CellArray);
getGroupDetails?: GroupDetailsCallback;
getRowThemeOverride?: GetRowThemeCallback;
gridSelection?: GridSelection;
groupHeaderHeight?: number;
headerHeight?: number;
headerIcons?: SpriteMap;
height?: string | number;
highlightRegions?: readonly Highlight[];
imageEditorOverride?: ImageEditorType;
imageWindowLoader?: ImageWindowLoader;
initialSize?: readonly [number, number];
isDraggable?: boolean | "header" | "cell";
isOutsideClick?: ((e) => boolean);
keybindings?: Partial<Keybinds>;
markdownDivCreateNode?: ((content) => DocumentFragment);
maxColumnAutoWidth?: number;
maxColumnWidth?: number;
minColumnWidth?: number;
onCellActivated?: ((cell) => void);
onCellClicked?: ((cell, event) => void);
onCellContextMenu?: ((cell, event) => void);
onCellEdited?: ((cell, newValue) => void);
onCellsEdited?: ((newValues) => boolean | void);
onColumnMoved?: ((startIndex, endIndex) => void);
onColumnResize?: ((column, newSize, colIndex, newSizeWithGrow) => void);
onColumnResizeEnd?: ((column, newSize, colIndex, newSizeWithGrow) => void);
onColumnResizeStart?: ((column, newSize, colIndex, newSizeWithGrow) => void);
onDelete?: ((selection) => boolean | GridSelection);
onDragLeave?: (() => void);
onDragOverCell?: ((cell, dataTransfer) => void);
onDragStart?: ((args) => void);
onDrop?: ((cell, dataTransfer) => void);
onFillPattern?: ((event) => void);
onFinishedEditing?: ((newValue, movement) => void);
onGridSelectionChange?: ((newSelection) => void);
onGroupHeaderClicked?: ((colIndex, event) => void);
onGroupHeaderContextMenu?: ((colIndex, event) => void);
onGroupHeaderRenamed?: ((groupName, newVal) => void);
onHeaderClicked?: ((colIndex, event) => void);
onHeaderContextMenu?: ((colIndex, event) => void);
onHeaderMenuClick?: ((col, screenPosition) => void);
onItemHovered?: ((args) => void);
onKeyDown?: ((event) => void);
onKeyUp?: ((event) => void);
onMouseMove?: ((args) => void);
onPaste?: boolean | ((target, values) => boolean);
onRowAppended?: (() => void | Promise<undefined | number | "bottom" | "top">);
onRowMoved?: ((startIndex, endIndex) => void);
onSearchClose?: (() => void);
onSearchResultsChanged?: ((results, navIndex) => void);
onSearchValueChange?: ((newVal) => void);
onSelectionCleared?: (() => void);
onVisibleRegionChanged?: ((range, tx, ty, extras) => void);
overscrollX?: number;
overscrollY?: number;
preventDiagonalScrolling?: boolean;
provideEditor?: ProvideEditorCallback<GridCell>;
rangeSelect?: "rect" | "none" | "cell" | "multi-cell" | "multi-rect";
rangeSelectionBlending?: SelectionBlending;
rightElement?: ReactNode;
rightElementProps?: {
fill?: boolean;
sticky?: boolean;
};
rowHeight?: number | ((index) => number);
rowMarkerStartIndex?: number;
rowMarkerTheme?: Partial<Theme>;
rowMarkerWidth?: number;
rowMarkers?: "number" | "none" | "checkbox" | "both" | "checkbox-visible" | "clickable-number";
rowSelect?: "none" | "single" | "multi";
rowSelectionBlending?: SelectionBlending;
rowSelectionMode?: "auto" | "multi";
rows: number;
scaleToRem?: boolean;
scrollOffsetX?: number;
scrollOffsetY?: number;
searchResults?: readonly Item[];
searchValue?: string;
showSearch?: boolean;
smoothScrollX?: boolean;
smoothScrollY?: boolean;
spanRangeBehavior?: "default" | "allowPartial";
theme?: Partial<Theme>;
trailingRowOptions?: {
addIcon?: string;
hint?: string;
sticky?: boolean;
targetColumn?: number | GridColumn;
tint?: boolean;
};
validateCell?: ((cell, newValue, prevValue) => boolean | ValidatedGridCell);
verticalBorder?: boolean | ((col) => boolean);
width?: string | number;
}Required Props
Name
Description
Important Props
Name
Description
Search
Name
Description
Row Markers
Name
Description
Styling
Name
Description
Selection Handling
Name
Description
Editing
Name
Description
Input Interaction
Name
Description
Drag and Drop
Name
Description
Custom Cells
Name
Description
Rarely Used
Name
Description
Last updated