FWorkSheetsPivotMixin
| packages | @univerjs-pro/sheets-pivot |
|---|
APIs
getPivotTableByCell
Signature
getPivotTableByCell(row: number, col: number): FPivotTable | undefinedParameters
row(number) — The checked row.col(number) — The checked column.
Returns
- (
FPivotTable | undefined) — The pivot table instance or undefined.
Tags
@description— Get the pivot table id by the cell in current sheet.
Examples
const fWorkbook = univerAPI.getActiveWorkbook()
const fSheet = fWorkbook.getActiveSheet()
const pivotTable = fSheet.getPivotTableByCell(1, 1)
if (pivotTable) {
pivotTable.addField(1, univerAPI.Enum.PivotTableFiledAreaEnum.Row, 0)
}