API
Function description: The props parameter of the React SheetComponent component
Parameter | Description | Type | Default | Required |
---|---|---|---|---|
sheetType | Form type: 1. pivot : pivot table2. table : detail table3. gridAnalysis : grid analysis table4. strategy : trend analysis table | pivot | table | gridAnalysis | strategy | pivot | ||
spreadsheet | custom table | (container: HTMLElement | string , dataCfg: S2DataConfig, options: SheetComponentOptions) => [SpreadSheet](/ docs/api/basic-class/spreadsheet) | ||
dataCfg | Pivot table data mapping related configuration items | S2DataConfig | ✓ | |
options | pivot table property configuration item | SheetComponentOptions | ✓ | |
partDrillDown | Attributes related to dimension drilldown | PartDrillDown | ||
adaptive | Whether to adapt to the window size | `boolean | { width?: boolean, height?: boolean, getContainer: () => HTMLElement }` | false |
themeCfg | Custom pivot table theme styles | ThemeCfg | ||
loading | Controls the loading state of the table | boolean | ||
header | header configuration items | HeaderCfgProps | ||
onRangeSort | Callback event triggered when sorting within a group | (params: SortParam[] ) => void; | ||
onRowCellHover | Row header mouse hover event | (data: TargetCellInfo) => void | ||
onRowCellClick | row head mouse click event | (data: TargetCellInfo) => void | ||
onRowCellDoubleClick | Mouse double-click event at row head | (data: TargetCellInfo) => void | ||
onRowCellMouseDown | row header mouse down event | (data: TargetCellInfo) => void | ||
onRowCellMouseUp | Row cell mouse release event | (data: TargetCellInfo) => void | ||
onRowCellMouseMove | Row cell mouse movement event | (data: TargetCellInfo) => void | ||
onRowCellCollapsed | Node expand/collapse event callback | ({ isCollapsed: boolean , collapseFields: Record<string, boolean> , node: Node ) => void; | ||
onRowCellAllCollapsed | Event callback for all nodes expanded/collapsed | (isCollapsed: boolean ) => void; | ||
onRowCellScroll | row header cell scroll event | ({position: CellScrollPosition} ) => void; | ||
onColCellHover | Column header mouse hover event | (data: TargetCellInfo) => void | ||
onColCellClick | Column head mouse click event | (data: TargetCellInfo) => void | ||
onColCellDoubleClick | Mouse double-click event of column header | (data: TargetCellInfo) => void | ||
onColCellMouseDown | Column header mouse down event | (data: TargetCellInfo) => void | ||
onColCellMouseUp | Column header mouse release event | (data: TargetCellInfo) => void | ||
onColCellMouseMove | Column head mouse move event | (data: TargetCellInfo) => void | ||
onColCellExpanded | After the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for column header expansion | (collapseAll: boolean ) => void; | ||
onColCellHidden | After the hidden column header is enabled (tooltip.operation.hiddenColumns = true), the event callback for the hidden column header | ({data: { currentHiddenColumnsInfo:HiddenColumnsInfo;hiddenColumnsDetail:HiddenColumnsInfo;} ) => void; | ||
onDataCellHover | mouse hover event of numeric cell | (data: TargetCellInfo) => void | ||
onDataCellClick | Mouse click event of numeric cell | (data: TargetCellInfo) => void | ||
onDataCellDoubleClick | Value cell double click event | (data: TargetCellInfo) => void | ||
onDataCellMouseDown | Mouse down event of numeric cell | (data: TargetCellInfo) => void | ||
onDataCellMouseUp | Numeric cell mouse release event | (data: TargetCellInfo) => void | ||
onDataCellMouseMove | Numeric cell mouse movement event | (data: TargetCellInfo) => void | ||
onDataCellBrushSelection | Value cell brush selection event | ( dataCells: DataCell[] ) => void | ||
onDataCellSelectMove | Numerical cell keyboard direction key move event | (metas: CellMeta[]) => void | ||
onCornerCellHover | corner mouse hover event | (data: TargetCellInfo) => void | ||
onCornerCellClick | Corner mouse click event | (data: TargetCellInfo) => void | ||
onCornerCellDoubleClick | Corner cell double click event | (data: TargetCellInfo) => void | ||
onCornerCellMouseUp | corner mouse down event | (data: TargetCellInfo) => void | ||
onCornerCellMouseUp | corner mouse release event | (data: TargetCellInfo) => void | ||
onCornerCellMouseMove | corner mouse movement event | (data: TargetCellInfo) => void | ||
onMergedCellsHover | Mouseover event of merged cells | (data: TargetCellInfo) => void | ||
onMergedCellsClick | Mouse click event of merged cells | (data: TargetCellInfo) => void | ||
onMergedCellDoubleClick | Mouse double-click event for merged cells | (data: TargetCellInfo) => void | ||
onMergedCellsMouseDown | Merged cell press event | (data: TargetCellInfo) => void | ||
onMergedCellsMouseUp | Merged cell release event | (data: TargetCellInfo) => void | ||
onMergedCellsMouseMove | merged cell move event | (data: TargetCellInfo) => void | ||
onRangeSort | A callback event is triggered when sorting within a group (for now only pivot tables are supported) | (params: SortParam[] ) => void; | ||
onRangeSorted | A callback event is triggered when the sorting in the group ends (for now, only pivot tables are supported) | (event: CanvasEvent ) => void; | ||
onRangeFilter | Trigger callback event when filtering | (data: { filterKey: string; filteredValues: string[] } ) => void; | ||
onRangeFiltered | Trigger callback event after filtering | (data: DataType[] ) => void; | ||
onLayoutCellRender | The header layout cell mount completed event | cell: S2CellType | ||
onLayoutAfterHeaderLayout | Header layout structure preparation completion event | (layoutResult: LayoutResult ) => void; | ||
onLayoutPagination | pagination event | ({ pageSize: number; pageCount: number; total: number; current: number;} ) => void; | ||
onLayoutCellScroll | Cell scroll event (Deprecated, please use onScroll instead) | ({position: CellScrollPosition} ) => void; | ||
onLayoutAfterCollapseRows | Event callback after collapsing row headers in tree mode | ({collapseFields: Record<string, boolean> , meta: Node ) => void; | ||
onBeforeRender | Event before start of render | () => void; | ||
onAfterRender | render completed event | () => void; | ||
onMounted | Table loading complete event, you can get the table instance details | (spreadsheet: SpreadSheet) => void; | ||
onDestroy | form destruction event | () => void; | ||
onLayoutResize | The overall changeSize event of the table | (params: ResizeParams) => void; | ||
onLayoutResizeSeriesWidth | Table serial number row width event | (params: ResizeParams) => void; | ||
onLayoutResizeRowWidth | row header cell width change event | (params: ResizeParams) => void; | ||
onLayoutResizeRowHeight | Row header cell height change event | (params: ResizeParams) => void; | ||
onLayoutResizeColWidth | Column header cell width change event | (params: ResizeParams) => void; | ||
onLayoutResizeColHeight | Column header cell height change event | (params: ResizeParams) => void; | ||
onLayoutResizeTreeWidth | The overall width change event of the tree line header | (params: ResizeParams) => void; | ||
onLayoutResizeMouseDown | mouse down event of resize hotspot | ( event: MouseEvent , resizeInfo?: ResizeInfo) => void; | ||
onLayoutResizeMouseUp | mouse release event of resize hotspot | ( event: MouseEvent , resizeInfo?: ResizeInfo) => void; | ||
onLayoutResizeMouseMove | mouse move event of resize hotspot | ( event: MouseEvent , resizeInfo?: ResizeInfo) => void; | ||
onKeyBoardDown | keyboard down event | (event: KeyboardEvent) => void | ||
onKeyBoardUp | keyboard release event | (event: KeyboardEvent) => void | ||
onCopied | copy event | (data: string) => void | ||
onActionIconHover | Line header operation icon hover event | (event: CanvasEvent) => void | ||
onActionIconClick | Action icon click event | (event: CanvasEvent) => void | ||
onContextMenu | Right cell click event | (data: TargetCellInfo) => void | ||
onMouseHover | table mouse hover event | (event: CanvasEvent) => void | ||
onMouseUp | table mouse release event | (event: CanvasEvent) => void | ||
onSelected | cell selected event | (cells: ( Cell[] ) => void | ||
onReset | Interactive state reset event | (event: KeyboardEvent) => void | ||
onLinkFieldJump | Link field jump event (cellData: @antv/s2 1.37.0 new) | (data: { key: string; cellData: Node; record: Data }) => void | ||
onScroll | cell scroll event (including row header and value cells) | ({position: CellScrollPosition} ) => void; | ||
onColCellBrushSelection | Batch select the column header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables) | (cells: ColCell[]) => void; | ||
onRowCellBrushSelection | Batch select the row header cells within the brush selection range. During the brush selection process, the brush selection range prompt mask will be displayed. After the brush selection is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables) | ( cells: RowCell[]) => void; |