logo

S2

  • Manual
  • API
  • Examples
  • Playground
  • ChangeLog
  • Productsantv logo arrow
  • 2.x
  • Common Configuration
    • S2DataConfig
    • S2Options
      Updated
    • S2Theme
      Updated
    • S2Event
  • Basic Class
    • SpreadSheet
    • Interaction
      Updated
    • Store
    • BaseCell
      Updated
    • BaseDataSet
    • Node
    • BaseTooltip
    • BaseFacet
      Updated
    • Hierarchy
      New
    • BaseBBox
      New
    • CellData
      New
  • Components
    • table component
    • DrillDown
    • Switcher
    • Advanced Sort
    • Export
      Updated
  • Graphic style
  • 透视组合图拓展 S2Options

S2Event

Previous
S2Theme
Next
SpreadSheet

Resources

Ant Design
Galacea Effects
Umi-React Application Framework
Dumi-Component doc generator
ahooks-React Hooks Library

Community

Ant Financial Experience Tech
seeconfSEE Conf-Experience Tech Conference

Help

GitHub
StackOverflow

more productsMore Productions

Ant DesignAnt Design-Enterprise UI design language
yuqueYuque-Knowledge creation and Sharing tool
EggEgg-Enterprise-class Node development framework
kitchenKitchen-Sketch Tool set
GalaceanGalacean-互动图形解决方案
xtechLiven Experience technology
© Copyright 2025 Ant Group Co., Ltd..备案号:京ICP备15032932号-38

Loading...

Table event list, you can listen to the required events according to actual needs, and realize custom business. details

If you are using the s2-react or s2-vue table component, the event has been encapsulated, and no additional monitoring is required, just use its callback function. details

import { S2Event } from '@antv/s2'
s2.on(S2Event.ROW_CELL_CLICK, (event) => {
console.log('rowCellClick', event)
});

Outfit

nameevent namedescribe
expand collapseS2Event.ROW_CELL_COLLAPSEDUnder the tree structure, row header cells expand/collapse
expand/collapse allS2Event.ROW_CELL_ALL_COLLAPSEDUnder the tree structure, all row header cells are expanded/collapsed
clickS2Event.ROW_CELL_CLICKrow header cell click
double clickS2Event.ROW_CELL_DOUBLE_CLICKRow header cell double click
right clickS2Event.ROW_CELL_CONTEXT_MENURow header cell right click
hoverS2Event.ROW_CELL_HOVERrow header cell hover
mouse downS2Event.ROW_CELL_MOUSE_DOWNrow header cell mouse down
mouse movementS2Event.ROW_CELL_MOUSE_MOVERow header cell mouse movement
mouse releaseS2Event.ROW_CELL_MOUSE_UPRow header cell mouse release
scrollS2Event.ROW_CELL_SCROLLrow header cell scrolling
Outfit selectionS2Event.ROW_CELL_BRUSH_SELECTIONBatch select the row header cells within the brushing range. During the brushing process, the brushing range prompt mask will be displayed. After the brushing is completed, a tooltip will pop up to display the brushed cell information (only supports pivot tables)

Header

nameevent namedescribe
clickS2Event.COL_CELL_CLICKColumn header cell click
double clickS2Event.COL_CELL_DOUBLE_CLICKColumn header cell double click
right clickS2Event.COL_CELL_CONTEXT_MENURight click on column header cell
hoverS2Event.COL_CELL_HOVERColumn header cell hover
mouse downS2Event.COL_CELL_MOUSE_DOWNcolumn header cell mouse down
mouse movementS2Event.COL_CELL_MOUSE_MOVEColumn header cell mouse movement
mouse releaseS2Event.COL_CELL_MOUSE_UPColumn header cell mouse release
Column head brush selectionS2Event.COL_CELL_BRUSH_SELECTIONBatch select the column header cells within the brushing range. During the brushing process, the brushing range prompt mask will be displayed. After the brushing is completed, a tooltip will pop up to display the brushed cell information (only pivot tables are supported)

value cell

nameevent namedescribe
clickS2Event.DATA_CELL_CLICKValue cell click
double clickS2Event.DATA_CELL_DOUBLE_CLICKValue cell double click
right clickS2Event.DATA_CELL_CONTEXT_MENUright click value cell
hoverS2Event.DATA_CELL_HOVERValue cell hover
mouse downS2Event.DATA_CELL_MOUSE_DOWNvalue cell mouse click
mouse movementS2Event.DATA_CELL_MOUSE_MOVENumeric cell mouse movement
mouse releaseS2Event.DATA_CELL_MOUSE_UPValue cell mouse release
SwipeS2Event.DATA_CELL_BRUSH_SELECTIONValue cell selection

Corner head

nameevent namedescribe
clickS2Event.CORNER_CELL_CLICKCorner header cell click
double clickS2Event.CORNER_CELL_DOUBLE_CLICKCorner cell double click
right clickS2Event.CORNER_CELL_CONTEXT_MENUCorner cell right click
hoverS2Event.CORNER_CELL_HOVERcorner header cell hover
mouse downS2Event.CORNER_CELL_MOUSE_DOWNCorner cell mouse down
mouse movementS2Event.CORNER_CELL_MOUSE_MOVECorner cell mouse movement
mouse releaseS2Event.CORNER_CELL_MOUSE_UPCorner header cell mouse release

Width and height drag adjustment

nameevent namedescribe
cell adjustmentS2Event.LAYOUT_RESIZECell width and height change
Ordinal column width changedS2Event.LAYOUT_RESIZE_SERIES_WIDTHOrdinal column width changed
Mouse down when resizing a cellS2Event.LAYOUT_RESIZE_MOUSE_DOWNAdjust the cell size by pressing the mouse, currently only the row/column header is valid
Mouse movement when resizing cellS2Event.LAYOUT_RESIZE_MOUSE_MOVEAdjust the cell size and move the mouse, currently only the row/column header is valid
Mouse up when resizing a cellS2Event.LAYOUT_RESIZE_MOUSE_UPAdjust the cell size and release the mouse, currently only the row/column header is valid
Header width changesS2Event.LAYOUT_RESIZE_ROW_WIDTH
line head height changeS2Event.LAYOUT_RESIZE_ROW_HEIGHT
Column header width changesS2Event.LAYOUT_RESIZE_COL_WIDTH
column header height changeS2Event.LAYOUT_RESIZE_COL_HEIGHT
Tree structure width changesS2Event.LAYOUT_RESIZE_TREE_WIDTHTriggered when the cell width changes in tree mode

layout

nameevent namedescribe
Header layout completeS2Event.LAYOUT_AFTER_HEADER_LAYOUTTriggered after row header and column header layout is completed
Numerical cell layout completeS2Event.LAYOUT_AFTER_REAL_DATA_CELL_RENDERTriggered after the rendering of the value cell in the current visible range is completed
pagingS2Event.LAYOUT_PAGINATIONpagination event
column header expansionS2Event.COL_CELL_EXPANDEDTriggered when the column header is expanded
column header hiddenS2Event.COL_CELL_HIDDENTriggered when the column header is hidden
start renderingS2Event.LAYOUT_BEFORE_RENDERThe event before starting render, that is, s2.render()
rendering completeS2Event.LAYOUT_AFTER_RENDERThe event that render is completed, that is, s2.render()
form destructionS2Event.LAYOUT_DESTROYTriggered after the table is destroyed or calling s2.destroy()

global

nameevent namedescribe
keyboard pressS2Event.GLOBAL_KEYBOARD_DOWNkeyboard press
keyboard releaseS2Event.GLOBAL_KEYBOARD_UPkeyboard release
copyS2Event.GLOBAL_COPIEDCopy selected cells
mouse releaseS2Event.GLOBAL_MOUSE_UPChart area mouse release
clickS2Event.GLOBAL_CLICKChart area click
Image/Video Preview clickS2Event.GLOBAL_PREVIEW_CLICKImage/Video Preview click
right clickS2Event.GLOBAL_CONTEXT_MENURight click on the chart area
selectedS2Event.GLOBAL_SELECTEDWhen selecting a cell, such as: brush selection, multiple selection, single selection
hoverS2Event.GLOBAL_HOVERmouse over cell
resetS2Event.GLOBAL_RESETWhen clicking on an empty space, pressing the Esc key resets the interaction style
link jumpS2Event.GLOBAL_LINK_FIELD_JUMPWhen clicked row column header is edited as text of link field
icon clickS2Event.GLOBAL_ACTION_ICON_CLICKWhen the operation icon on the right side of the cell is clicked, for example: sort icon
icon hoverS2Event.GLOBAL_ACTION_ICON_HOVERWhen hovering over the operation icon on the right side of the cell, for example: sort icon
scrollS2Event.GLOBAL_SCROLLTable scrolling (with values and row header cells)