This is an automated email from the ASF dual-hosted git repository. amaan pushed a commit to branch fix/ag-grid-boolean-checkbox in repository https://gitbox.apache.org/repos/asf/superset.git
commit f1632efd7041686cecd98dbaac5bb8118589dc97 Author: amaannawab923 <[email protected]> AuthorDate: Fri Feb 27 03:19:39 2026 +0530 fix(ag-grid-table): render boolean columns as checkboxes instead of raw text --- .../src/components/ThemedAgGridReact/index.tsx | 3 +++ .../src/utils/useColDefs.ts | 29 +++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx index 7767fbaf037..7742eb06eda 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/ThemedAgGridReact/index.tsx @@ -105,6 +105,9 @@ export const ThemedAgGridReact = forwardRef< borderColor: theme.colorSplit, columnBorderColor: theme.colorSplit, + // Checkbox tick color + checkboxCheckedShapeColor: theme.colorBgElevated, + // Interactive elements accentColor: theme.colorPrimary, rangeSelectionBorderColor: theme.colorPrimary, diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts index 1879260d451..74f204476fc 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts @@ -263,6 +263,7 @@ export const useColDefs = ({ const isTextColumn = dataType === GenericDataType.String || dataType === GenericDataType.Temporal; + const isBooleanColumn = dataType === GenericDataType.Boolean; const valueRange = !hasBasicColorFormatters && @@ -325,18 +326,22 @@ export const useColDefs = ({ 'last', ], }), - cellRenderer: (p: CellRendererProps) => - isTextColumn ? TextCellRenderer(p) : NumericCellRenderer(p), - cellRendererParams: { - allowRenderHtml: true, - columns, - hasBasicColorFormatters, - col, - basicColorFormatters, - valueRange, - alignPositiveNegative: alignPN || alignPositiveNegative, - colorPositiveNegative, - }, + // Boolean columns use AG Grid's built-in agCheckboxCellRenderer + // via cellDataType: 'boolean', so skip custom cellRenderer for them + ...(!isBooleanColumn && { + cellRenderer: (p: CellRendererProps) => + isTextColumn ? TextCellRenderer(p) : NumericCellRenderer(p), + cellRendererParams: { + allowRenderHtml: true, + columns, + hasBasicColorFormatters, + col, + basicColorFormatters, + valueRange, + alignPositiveNegative: alignPN || alignPositiveNegative, + colorPositiveNegative, + }, + }), context: { isMetric, isPercentMetric,
