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

Switcher

Previous
DrillDown
Next
Advanced Sort

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

React Dimension Toggle Component

Switcher Component Props

AttributesillustratetypeDefaultsrequired
rowsHeader configuration descriptionSwitcherField
columnsColumn Header Configuration DescriptionSwitcherField
valuesIndicator configuration descriptionSwitcherField
disabledWhether to disablebooleanfalse
titleOpen the trigger node of the toggle popup windowReactNode
contentTitleTextPopup window default title textstringRow and column switching
resetTextreset button textstringreset
innerContentClassNamePopup box content style namestring
allowExchangeHeaderWhether to allow indicators to switch between row and column dimensionsbooleantrue
onSubmitAfter the popup window is closed, the callback function for processing the row and column switching result(result: SwitcherResult ) => void
popoverPopup window configuration, transparently passed to the antd component of PopoverPopoverProps

SwitcherField

Row and column headers and index value configuration description objects

AttributesillustratetypeDefaultsrequired
itemsConfigure field objectsSwitcherItem []-✓
expandableWhether to open the checkbox for expanding subitems is used to control the expansion and hiding of subitemsbooleanfalse
expandTextExpand the text corresponding to the checkbox of the subitemstring展开子项
selectableWhether to open the checkbox of the field to control the display and hidingbooleanfalse
allowEmptyWhether the current dimension can drag out all sub-itemsbooleantrue

SwitcherItem

Configure field objects

AttributesillustratetypeDefaultsrequired
idfield idstring-✓
displayNameThe name of the field is displayed, and the id is displayed directly when the field does not existstring-
checkedWhether the field needs to be displayedbooleantrue
childrenIf the field has associated sub-items (such as: same-ring ratio), use this property to configure the sub-itemsSwitcherItem [][]

SwitcherResult

After the popup window is closed, the parameter of the callback function that processes the row and column switching result

AttributesillustratetypeDefaultsrequired
rowsAll line header field operation resultsSwitcherResultItem
columnsAll column header field operation resultsSwitcherResultItem
valuesAll indicator field operation resultsSwitcherResultItem

SwitcherResultItem

After closing the pop-up window, the description object of each dimension result

AttributesillustratetypeDefaultsrequired
itemsA flattened collection of all fields, sorted in order after draggingSwitcherItem [][]
hideItemsAll collections that need to be flattened with hidden fields, sorted in order after draggingSwitcherItem [][]

SwitcherCfgProps

Built-in header component configuration parameters, essentially a subset of Switcher component Props

AttributesillustratetypeDefaultsrequired
sheetTypeForm type:
1. pivot : pivot table
2. table : detailed list
3. gridAnalysis : grid analysis table
4. strategy : trend analysis table
`pivottablegridAnalysis
titleOpen the trigger node of the toggle popup windowReactNode
contentTitleTextPopup window default title textstringRow and column switching
resetTextreset button textstringreset
innerContentClassNamePopup box content style namestring
popoverPopup window configuration, transparently passed to the antd component of PopoverPopoverProps
disabledWhether to disablebooleanfalse

Vue Dimension Toggle Component

In development, please look forward to