This is an automated email from the ASF dual-hosted git repository.
rusackas pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/superset.git
The following commit(s) were added to refs/heads/master by this push:
new d6689283942 fix(sql-lab): use function valueGetter for GridTable row
numbers (#41574)
d6689283942 is described below
commit d66892839423ec47d7e379783f3a60fb84719ded
Author: hahaok <[email protected]>
AuthorDate: Sat Oct 3 13:14:33 2026 +0800
fix(sql-lab): use function valueGetter for GridTable row numbers (#41574)
Co-authored-by: chenshaobo <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Evan Rusackas <[email protected]>
---
superset-frontend/src/components/GridTable/index.tsx | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/superset-frontend/src/components/GridTable/index.tsx
b/superset-frontend/src/components/GridTable/index.tsx
index 5bcf27cb44c..04ae59fb015 100644
--- a/superset-frontend/src/components/GridTable/index.tsx
+++ b/superset-frontend/src/components/GridTable/index.tsx
@@ -19,7 +19,12 @@
import { useCallback, useMemo } from 'react';
import { css, useTheme } from '@apache-superset/core/theme';
import { ThemedAgGridReact } from '@superset-ui/core/components';
-import type { CellKeyDownEvent, Column, GridOptions } from 'ag-grid-community';
+import type {
+ CellKeyDownEvent,
+ Column,
+ GridOptions,
+ ValueGetterParams,
+} from 'ag-grid-community';
import type { AgGridReactProps } from 'ag-grid-react';
import copyTextToClipboard from 'src/utils/copy';
@@ -85,7 +90,8 @@ export function GridTable<RecordType extends object>({
[
{
field: PIVOT_COL_ID,
- valueGetter: 'node.rowIndex+1',
+ valueGetter: (params: ValueGetterParams) =>
+ (params.node?.rowIndex ?? 0) + 1,
cellClass: 'row-number-col',
cellStyle: {
backgroundColor: theme.colorFillTertiary,