mirror of
https://github.com/apache/superset.git
synced 2026-04-22 17:45:21 +00:00
fix(dashboard): preserve dynamic group by column order (#39333)
This commit is contained in:
committed by
GitHub
parent
1462ac9282
commit
0f417f0040
@@ -56,6 +56,7 @@ import SearchSelectDropdown from './components/SearchSelectDropdown';
|
||||
import { SearchOption, SortByItem } from '../types';
|
||||
import getInitialSortState, { shouldSort } from '../utils/getInitialSortState';
|
||||
import getInitialFilterModel from '../utils/getInitialFilterModel';
|
||||
import reconcileColumnState from '../utils/reconcileColumnState';
|
||||
import { PAGE_SIZE_OPTIONS } from '../consts';
|
||||
import { getCompleteFilterState } from '../utils/filterStateManager';
|
||||
|
||||
@@ -429,10 +430,17 @@ const AgGridDataTable: FunctionComponent<AgGridTableProps> = memo(
|
||||
// Note: filterModel is now handled via gridInitialState for better performance
|
||||
if (chartState?.columnState && params.api) {
|
||||
try {
|
||||
params.api.applyColumnState?.({
|
||||
state: chartState.columnState as ColumnState[],
|
||||
applyOrder: true,
|
||||
});
|
||||
const reconciledColumnState = reconcileColumnState(
|
||||
chartState.columnState as ColumnState[],
|
||||
colDefsFromProps as ColDef[],
|
||||
);
|
||||
|
||||
if (reconciledColumnState) {
|
||||
params.api.applyColumnState?.({
|
||||
state: reconciledColumnState.columnState,
|
||||
applyOrder: reconciledColumnState.applyOrder,
|
||||
});
|
||||
}
|
||||
} catch {
|
||||
// Silently fail if state restoration fails
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user