diff --git a/app/gui2/src/components/visualizations/TableVisualization.vue b/app/gui2/src/components/visualizations/TableVisualization.vue index 03b29d8883a5..3f4fd86fc91b 100644 --- a/app/gui2/src/components/visualizations/TableVisualization.vue +++ b/app/gui2/src/components/visualizations/TableVisualization.vue @@ -631,6 +631,7 @@ onMounted(() => { :columnDefs="columnDefs" :rowData="rowData" :defaultColDef="defaultColDef" + :textFormatOption="textFormatterSelected" @sortOrFilterUpdated="(e) => checkSortAndFilter(e)" /> diff --git a/app/gui2/src/components/widgets/AgGridTableView.vue b/app/gui2/src/components/widgets/AgGridTableView.vue index 3aa587c12c3c..cca644b2bbeb 100644 --- a/app/gui2/src/components/widgets/AgGridTableView.vue +++ b/app/gui2/src/components/widgets/AgGridTableView.vue @@ -29,7 +29,8 @@ import type { GridApi, RowHeightParams, } from 'ag-grid-enterprise' -import { type ComponentInstance, reactive, ref, shallowRef } from 'vue' +import { type ComponentInstance, reactive, ref, shallowRef, watch } from 'vue' +import { TextFormatOptions } from '../visualizations/TableVisualization.vue' const DEFAULT_ROW_HEIGHT = 22 @@ -41,6 +42,7 @@ const _props = defineProps<{ components?: Record singleClickEdit?: boolean stopEditingWhenCellsLoseFocus?: boolean + textFormatOption?: TextFormatOptions }>() const emit = defineEmits<{ cellEditingStarted: [event: CellEditingStartedEvent] @@ -62,6 +64,9 @@ function onGridReady(event: GridReadyEvent) { } function getRowHeight(params: RowHeightParams): number { + if (_props.textFormatOption === TextFormatOptions.Off) { + return DEFAULT_ROW_HEIGHT + } const rowData = Object.values(params.data) const textValues = rowData.filter((r): r is string => typeof r === 'string') @@ -80,6 +85,14 @@ function getRowHeight(params: RowHeightParams): number { return (maxReturnCharsCount + 1) * DEFAULT_ROW_HEIGHT } +watch( + () => _props.textFormatOption, + () => { + gridApi.value?.redrawRows() + gridApi.value?.resetRowHeights() + }, +) + function updateColumnWidths(event: FirstDataRenderedEvent | RowDataUpdatedEvent) { if (event.columnApi == null) { console.warn('AG Grid column API does not exist.')