logo

S2

  • Manual
  • API
  • Examples
  • Playground
  • ChangeLog
  • Productsantv logo arrow
  • 2.x
  • Introduction
  • Quick Start
  • Basic Tutorial
    • Base Concept
    • Sheet Type
      • Pivot Mode
        Updated
      • Table Mode
    • Conditions
      Updated
    • Totals
    • Sort
      • Custom Sort
        Updated
      • Group Sort
        Updated
    • Theme
      Updated
    • Tooltip
      Updated
    • Internationalization
    • 数据格式化
      New
    • Multi Line
      New
    • Pagination
      New
  • Advanced Tutorial
    • Advanced Tutorial
      • Link
      • Render Chart In Cell
      • Draw Chart With @antv/g2
    • Custom
      • Customize Hook
        Updated
      • Customize Tree
        New
      • Customize Icon
      • Customize Cell Alignment
      • Customize Cell Size
        Updated
      • Customize Order
      • Custom Collapse/Expand Nodes
    • Interaction
      • Basic Interaction
      • Custom Interaction
      • Hide Columns
      • Cell Resize
      • Merge Cell
      • Scroll
      • Copy
        New
      • Highlight and select cell
        New
    • Analyze Component
      • Introduction
        New
      • Advanced Sort
        Updated
      • Switcher
      • Export
        Updated
      • Pagination
      • Drill Down
    • Sheet Component
      • Editable Mode
      • Strategy Sheet
        Updated
    • HD Adapter
    • Get Instance
    • Get Cell Data
      Updated
    • Table adaptive
    • AntV/G Plugins
      New
    • Pivot Chart
      Experimental
    • Vue 3.0
  • Extended Reading
    • Data Process
      • Pivot
      • Table
    • Layout
      • Pivot
      • Table
    • Performance
      Updated
  • Contribution
  • FAQ
  • S2 2.0 Migration Guide

Link

Previous
Pagination
Next
Render Chart In Cell

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...

Mark the cell text as an underlined link style to achieve link jumps 🔗, there are subtle differences between pivot tables and schedule tables

preview

tag link field

const s2DataConfig = {
fields: {
rows: ['province', 'city'],
columns: ['type'],
values: ['price'],
},
};
const s2Options = {
width: 600,
height: 600,
interaction: {
linkFields: ['city'],
}
};

Use S2Event.GLOBAL_LINK_FIELD_JUMP listen for link clicks

import { S2Event } from '@antv/s2'
s2.on(S2Event.GLOBAL_LINK_FIELD_JUMP, (data) => {
const { key, record } = data;
...
});

pivot table

Support to mark row header rows as link style, columns and values are invalid

import { S2Event } from '@antv/s2'
const s2DataConfig = {
fields: {
rows: ['province', 'city'],
columns: ['type'],
values: ['price'],
},
};
const s2Options = {
width: 600,
height: 600,
interaction: {
linkFields: ['province', 'city'],
}
};
const s2 = new PivotSheet(container, s2DataConfig, s2Options);
s2.on(S2Event.GLOBAL_LINK_FIELD_JUMP, (data) => {
const { key, record } = data;
const value = record[key]
// 拼装自己的跳转地址
location.href = `https://path/to/${key}=${value}}`;
});
s2.render();

list

Support to mark row header columns as link style

import { S2Event } from '@antv/s2';
const s2DataConfig = {
fields: {
columns: ['type', 'price', 'province', 'city'],
},
};
const s2Options = {
width: 600,
height: 600,
interaction: {
linkFields: ['type', 'price', 'province'],
}
};
const s2 = new TableSheet(container, s2DataConfig, s2Options);
s2.on(S2Event.GLOBAL_LINK_FIELD_JUMP, (data) => {
const { key, record } = data;
const value = record[key]
// 拼装自己的跳转地址
location.href = `https://path/to/${key}=${value}}`;
});
s2.render();