mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
fix(ag-grid): render boolean columns as checkboxes instead of blank cells (#38279)
This commit is contained in:
@@ -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,25 @@ export const useColDefs = ({
|
||||
'last',
|
||||
],
|
||||
}),
|
||||
cellRenderer: (p: CellRendererProps) =>
|
||||
isTextColumn ? TextCellRenderer(p) : NumericCellRenderer(p),
|
||||
cellRendererParams: {
|
||||
allowRenderHtml: true,
|
||||
columns,
|
||||
hasBasicColorFormatters,
|
||||
col,
|
||||
basicColorFormatters,
|
||||
valueRange,
|
||||
alignPositiveNegative: alignPN || alignPositiveNegative,
|
||||
colorPositiveNegative,
|
||||
},
|
||||
...(isBooleanColumn
|
||||
? {
|
||||
cellRenderer: 'agCheckboxCellRenderer',
|
||||
cellRendererParams: { disabled: true },
|
||||
}
|
||||
: {
|
||||
cellRenderer: (p: CellRendererProps) =>
|
||||
isTextColumn ? TextCellRenderer(p) : NumericCellRenderer(p),
|
||||
cellRendererParams: {
|
||||
allowRenderHtml: true,
|
||||
columns,
|
||||
hasBasicColorFormatters,
|
||||
col,
|
||||
basicColorFormatters,
|
||||
valueRange,
|
||||
alignPositiveNegative: alignPN || alignPositiveNegative,
|
||||
colorPositiveNegative,
|
||||
},
|
||||
}),
|
||||
context: {
|
||||
isMetric,
|
||||
isPercentMetric,
|
||||
|
||||
Reference in New Issue
Block a user