API
Form parameter configuration
const s2Options = {
width: 600,
height: 400,
hierarchyType: 'grid'
}
parameter | type | required | Defaults | Functional description |
---|---|---|---|---|
width | number | 600 | table width | |
height | number | 480 | form height | |
debug | boolean | false | Whether to enable debug mode | |
hierarchyType | grid | tree | customTree | grid | The display method of line headers, grid: tiled grid structure, tree: tree structure. customTree: custom tree structure | |
conditions | Conditions | Conditional Mode Configuration | ||
totals | Totals | Subtotal Total Configuration | ||
tooltip | Tooltips | tooltip configuration | ||
interaction | Interaction | Form interaction configuration | ||
pagination | Pagination | paging configuration | ||
frozen | Frozen | Column Header Freezing Configuration | ||
seriesNumber | SeriesNumber | Whether to display the series number | ||
showDefaultHeaderActionIcon | boolean | true | Whether to display the default row and column header operation icons | |
headerActionIcons | HeaderActionIcon[] | false | Customize row and column header action icons (need to set showDefaultHeaderActionIcon to false ) | |
customSVGIcons | CustomSVGIcon[] | false | Custom svg icons | |
style | style | Cell style settings, such as layout type, width and height, margin, whether to hide the value column header, etc. | ||
hd | boolean | true | Whether to enable high-definition screen adaptation to solve the problem of blurred font rendering on high-definition retina screens when switching between multiple screens. see more | |
mergedCellsInfo | MergedCellInfo[][] | Merge cell information | ||
placeholder | string | (meta: Record<string, any>) => string | fill content for empty cells | ||
cornerText | string | Custom corner header text (valid when custom tree hierarchyType: customTree ) | ||
cornerExtraFieldText | string | Customize the text of the virtual value field of the corner header (valid when the value is linked to the line header, replace the two words "value") | ||
dataCell | DataCellCallback | custom cell | ||
cornerCell | Cell Callback | Custom cornerCell | ||
rowCell | Cell Callback | Custom header cell | ||
colCell | Cell Callback | Custom column header cell | ||
cornerHeader | CornerHeaderCallback | custom angle head | ||
layout Hierarchy | Layout Hierarchy | custom hierarchy | ||
layoutArrange | LayoutArrange | custom sort order | ||
layoutCoordinate | layoutCoordinate | custom coordinates | ||
layoutDataPosition | layoutDataPosition | custom data | ||
filterDisplayDataItem | FilterDataItemCallback | filter data | ||
mappingDisplayDataItem | MappingDataItemCallback | Convert data for tooltip display | ||
dataSet | DataSet | custom data set | ||
supportsCSSTransform | boolean | false | After enabling it, CSS transform is supported, which solves the problem that the mouse coordinates respond incorrectly after the parent element is set to transform | |
devicePixelRatio | number | window.devicePixelRatio | Custom Device Pixel Ratio |